diff --git a/linglong.yaml b/linglong.yaml new file mode 100644 index 0000000..862bbde --- /dev/null +++ b/linglong.yaml @@ -0,0 +1,92 @@ +version: "1" + +package: + id: net.sourceforge.simulide + name: simulide + version: 1.1.0.1912 + kind: app + description: | + SimulIDE is a simple real time electronic circuit simulator intended for + hobbyist and student experimentation with simple general purpose electronic + circuits and PIC, AVR and Arduino microcontroller simulations. + +command: + - /opt/apps/net.sourceforge.simulide/files/bin/simulide.sh + +base: org.deepin.base/23.1.0 +runtime: org.deepin.runtime.dtk/23.1.0 + +sources: + - kind: archive + url: https://share.cicd.getdeepin.org/ziggy-pool/linyaps-apps-packaging-CI/25M8.top500-init.stage-1.sysRepo/simulide_1.1.0.1912+dfsg.orig.tar.xz + digest: 7f65bf4b1a4b247f6ab5ecfa42324649002d90a8f01800d60949b77c63776798 + name: simulide_orig + - kind: archive + url: https://share.cicd.getdeepin.org/ziggy-pool/linyaps-apps-packaging-CI/25M8.top500-init.stage-1.sysRepo/simulide_1.1.0.1912+dfsg-4.debian.tar.xz + digest: 8fb65d7361562e26069745a6cee2a4b94fa47aa1e577d2317fe3f782b706e7ad + name: simulide_debian + +build: | + set -e + + # fix dead apt source baked into base 23.1.0 + cat > /etc/apt/sources.list <<'APT' + deb [trusted=yes] https://ci.deepin.com/repo/deepin/deepin-community/stable beige main + APT + echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/99linglong-builder.conf + apt-get update -y + + # build-time tooling and Qt5 development headers + DEBIAN_FRONTEND=noninteractive apt-get install -y \ + build-essential patch bzr \ + qtbase5-dev libqt5serialport5-dev libqt5svg5-dev \ + qtmultimedia5-dev qttools5-dev-tools libglib2.0-dev + + SRC=/project/linglong/sources/simulide_orig/simulide-1.1.0.1912+dfsg + DEB=/project/linglong/sources/simulide_debian/debian + + cd $SRC + + # apply the Debian patch series (build & fonts fixes) + for p in $(cat $DEB/patches/series); do + patch -p1 < $DEB/patches/$p + done + + # build with qmake; package version encodes the upstream sim-revision + export version="1.1.0" + export revision="1912" + export timestamp=$(date -u +%s) + + cd build_XX + export QT_SELECT=qt5 + qmake -makefile PREFIX=${PREFIX} + make -j$(nproc) + make install + + # bundle Qt5 serialport runtime library (not provided by dtk runtime) + mkdir -p $PREFIX/lib/${TRIPLET} + cp -a /usr/lib/${TRIPLET}/libQt5SerialPort.so* $PREFIX/lib/${TRIPLET}/ 2>/dev/null || true + + # bundle Qt5 multimedia plugins (gstreamer backend etc.) + mkdir -p $PREFIX/lib/${TRIPLET}/qt5/plugins + cp -a /usr/lib/${TRIPLET}/qt5/plugins/multimedia $PREFIX/lib/${TRIPLET}/qt5/plugins/ 2>/dev/null || true + cp -a /usr/lib/${TRIPLET}/qt5/plugins/mediaservice $PREFIX/lib/${TRIPLET}/qt5/plugins/ 2>/dev/null || true + + # create a launch wrapper that forces software OpenGL rendering + # (avoids zink/vulkan driver failures in headless test environments) + cat > $PREFIX/bin/simulide.sh <<'EOF' + #!/bin/bash + export LIBGL_ALWAYS_SOFTWARE=1 + export GALLIUM_DRIVER=llvmpipe + export QT_OPENGL=software + exec /opt/apps/net.sourceforge.simulide/files/bin/simulide "$@" + EOF + chmod +x $PREFIX/bin/simulide.sh + + # install the desktop entry and icon using the app id + mkdir -p $PREFIX/share/applications $PREFIX/share/icons/hicolor/48x48/apps + install -m 644 $DEB/net.launchpad.code.simulide.desktop $PREFIX/share/applications/net.sourceforge.simulide.desktop + install -m 644 ../resources/icons/simulide.png $PREFIX/share/icons/hicolor/48x48/apps/simulide.png + + echo "=== installed files ===" + find $PREFIX -maxdepth 6 \( -type f -o -type l \) | sort