diff options
Diffstat (limited to 'repo')
159 files changed, 6626 insertions, 383 deletions
diff --git a/repo/adoptopenjdk16/adoptopenjdk16.xibuild b/repo/adoptopenjdk16/adoptopenjdk16.xibuild index fa22105..414caff 100644 --- a/repo/adoptopenjdk16/adoptopenjdk16.xibuild +++ b/repo/adoptopenjdk16/adoptopenjdk16.xibuild @@ -6,8 +6,8 @@ DESC="AdoptOpenJDK Java 16 binaries" MAKEDEPS="make " PKG_VER=16.0.2 -RELEASE=10 -SOURCE="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$PKG_VER%2B10/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" +RELEASE=7 +SOURCE="https://github.com/adoptium/temurin16-binaries/releases/download/jdk-$PKG_VER%2B7/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" package () { out=$PKG_DEST/usr/lib/jvm/adoptopenjdk${PKG_VER%%.*} diff --git a/repo/adoptopenjdk17/adoptopenjdk17.xibuild b/repo/adoptopenjdk17/adoptopenjdk17.xibuild index 3c4133b..ea2928e 100644 --- a/repo/adoptopenjdk17/adoptopenjdk17.xibuild +++ b/repo/adoptopenjdk17/adoptopenjdk17.xibuild @@ -7,7 +7,7 @@ MAKEDEPS="make " PKG_VER=17.0.3 RELEASE=7 -SOURCE="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$PKG_VER%2B10/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" +SOURCE="https://github.com/adoptium/temurin17-binaries/releases/download/jdk-$PKG_VER%2B7/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" package () { out=$PKG_DEST/usr/lib/jvm/adoptopenjdk${PKG_VER%%.*} diff --git a/repo/adoptopenjdk18/adoptopenjdk18.xibuild b/repo/adoptopenjdk18/adoptopenjdk18.xibuild index b997515..984eb62 100644 --- a/repo/adoptopenjdk18/adoptopenjdk18.xibuild +++ b/repo/adoptopenjdk18/adoptopenjdk18.xibuild @@ -8,7 +8,7 @@ DEPS="less " PKG_VER=18.0.1 RELEASE=10 -SOURCE="https://github.com/adoptium/temurin11-binaries/releases/download/jdk-$PKG_VER%2B10/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" +SOURCE="https://github.com/adoptium/temurin18-binaries/releases/download/jdk-$PKG_VER%2B10/OpenJDK${PKG_VER%%.*}U-jdk_x64_alpine-linux_hotspot_${PKG_VER}_${RELEASE}.tar.gz" package () { out=$PKG_DEST/usr/lib/jvm/adoptopenjdk${PKG_VER%%.*} diff --git a/repo/ardour/ardour.xibuild b/repo/ardour/ardour.xibuild index 88beac7..96e030e 100644 --- a/repo/ardour/ardour.xibuild +++ b/repo/ardour/ardour.xibuild @@ -3,10 +3,10 @@ NAME="ardour" DESC="professional-grade digital audio workstation" -MAKEDEPS="alsa-lib atkmm aubio boost fftw gtk2 gtkmm itstool jack libarchive libexecinfo liblo libpng libsamplerate libsigc++ libsndfile lilv lrdf lv2 pulseaudio python readline redland rubberband serd sratom taglib vamp-sdk fluidsynth hidapi" +MAKEDEPS="alsa-lib atkmm aubio boost fftw gtk2 gtkmm3 itstool jack libarchive libexecinfo liblo libpng libsamplerate libsigc++ libsndfile lilv lrdf lv2 pulseaudio python readline redland rubberband serd sratom taglib vamp-sdk fluidsynth hidapi soundtouch gtkmm2" PKG_VER=6.9.0 -SOURCE="https://community.ardour.org/src/Ardour-$PKG_VER.tar.bz2" +SOURCE="https://dev.alpinelinux.org/archive/ardour/Ardour-$PKG_VER.tar.bz2" ADDITIONAL=" always-link-execinfo.patch diff --git a/repo/base/base.xibuild b/repo/base/base.xibuild index d773e40..d05c1ee 100644 --- a/repo/base/base.xibuild +++ b/repo/base/base.xibuild @@ -1,5 +1,5 @@ #!/bin/sh -DEPS="mksh bzip2 sbase findutils iana-etc file gawk gettext musl grep gzip iproute2 iputils xipkg pciutils procps-ng psmisc sed shadow tar util-linux xz linux-headers sysconfigs inetutils mkinitramfs genfstab eudev openrc kbd sysklogd tzdata" +DEPS="mksh bzip2 sbase findutils iana-etc file gawk gettext musl grep gzip iproute2 iputils xipkg pciutils procps-ng psmisc sed date shadow tar util-linux xz linux-headers sysconfigs inetutils mkinitramfs genfstab eudev openrc kbd sysklogd tzdata" MAKEDEPS="grep python" DESC="The base system to be installed" diff --git a/repo/cabal-stage0/cabal-stage0.xibuild b/repo/cabal-stage0/cabal-stage0.xibuild deleted file mode 100644 index 4905da8..0000000 --- a/repo/cabal-stage0/cabal-stage0.xibuild +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -NAME="cabal-stage0" -DESC="Cabal version used for bootstrapping" - -MAKEDEPS="make ghc" -DEPS="gmp libffi musl zlib " - -PKG_VER=5b4258cbfa536b6362c4e20578ced51676206ea8 -SOURCE="https://github.com/haskell/cabal" -BRANCH=$PKG_VER - -ADDITIONAL="linux-9.0.1.json depends-for-ghc-9.0.1.patch " - -prepare () { - apply_patches - cp linux-9.0.1.json "bootstrap" -} - -build () { - ./bootstrap/bootstrap.py \ - -d ./bootstrap/linux-9.0.1.json \ - -w "$(command -v ghc)" -} - -package () { - install -m 755 -D _build/bin/cabal "$PKG_DEST/usr/bin/cabal" - install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal-stage0/LICENSE" -} diff --git a/repo/cabal-stage0/depends-for-ghc-9.0.1.patch b/repo/cabal-stage0/depends-for-ghc-9.0.1.patch deleted file mode 100644 index 90dfae9..0000000 --- a/repo/cabal-stage0/depends-for-ghc-9.0.1.patch +++ /dev/null @@ -1,44 +0,0 @@ -A lot of packages do not work with GHC 9.0.1 by default since their -version constraint for packages from the standard library is too -restrictive. Adjust these version constrains to fix the build. - -Only in b: _build -diff -upr a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py ---- a/bootstrap/bootstrap.py 2021-11-17 20:24:56.563114540 +0100 -+++ b/bootstrap/bootstrap.py 2021-11-17 20:13:30.311479911 +0100 -@@ -147,6 +147,11 @@ def fetch_package(package: PackageName, - shutil.copyfileobj(resp, cabal_file.open('wb')) - verify_sha256(cabal_sha256, cabal_file) - -+ if package == "ed25519": -+ subprocess_run(["sed", "-e", "s/ghc-prim ..*/ghc-prim >= 0.1,/", "-i", cabal_file], check=True) -+ elif package == "hackage-security": -+ subprocess_run(["sed", "-e", "s/template-haskell ..*/template-haskell >= 2.7,/", "-i", cabal_file], check=True) -+ - return (tarball, cabal_file) - - def read_bootstrap_info(path: Path) -> BootstrapInfo: -diff -upr a/cabal-install/cabal-install.cabal b/cabal-install/cabal-install.cabal ---- a/cabal-install/cabal-install.cabal 2021-11-05 00:16:33.000000000 +0100 -+++ b/cabal-install/cabal-install.cabal 2021-11-17 20:17:03.488421095 +0100 -@@ -209,7 +209,7 @@ library - edit-distance >= 0.2.2 && < 0.3, - exceptions, - filepath >= 1.4.0.0 && < 1.5, -- hashable >= 1.0 && < 1.4, -+ hashable >= 1.0, - HTTP >= 4000.1.5 && < 4000.4, - mtl >= 2.0 && < 2.3, - network-uri >= 2.6.0.2 && < 2.7, -diff -upr a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal ---- a/cabal-install-solver/cabal-install-solver.cabal 2021-11-05 00:16:33.000000000 +0100 -+++ b/cabal-install-solver/cabal-install-solver.cabal 2021-11-17 19:42:41.703460745 +0100 -@@ -103,7 +103,7 @@ library - - build-depends: - , array >=0.4 && <0.6 -- , base >=4.10 && <4.15 -+ , base >=4.10 - , binary >=0.7.3 && <0.9 - , bytestring >=0.10.6.0 && <0.12 - , Cabal ^>=3.7 diff --git a/repo/cabal-stage0/linux-9.0.1.json b/repo/cabal-stage0/linux-9.0.1.json deleted file mode 100644 index 99cb1cb..0000000 --- a/repo/cabal-stage0/linux-9.0.1.json +++ /dev/null @@ -1 +0,0 @@ -{"builtin":[{"package":"rts","version":"1.0"},{"package":"ghc-prim","version":"0.7.0"},{"package":"ghc-bignum","version":"1.0"},{"package":"base","version":"4.15.0.0"},{"package":"array","version":"0.5.4.0"},{"package":"deepseq","version":"1.4.5.0"},{"package":"bytestring","version":"0.10.12.1"},{"package":"containers","version":"0.6.4.1"},{"package":"binary","version":"0.8.8.0"},{"package":"filepath","version":"1.4.2.1"},{"package":"time","version":"1.9.3"},{"package":"unix","version":"2.7.2.2"},{"package":"directory","version":"1.3.6.1"},{"package":"transformers","version":"0.5.6.2"},{"package":"mtl","version":"2.2.2"},{"package":"ghc-boot-th","version":"9.0.1"},{"package":"pretty","version":"1.1.3.6"},{"package":"template-haskell","version":"2.17.0.0"},{"package":"text","version":"1.2.4.1"},{"package":"parsec","version":"3.1.14.0"},{"package":"process","version":"1.6.11.0"},{"package":"stm","version":"2.5.0.0"},{"package":"exceptions","version":"0.10.4"}],"dependencies":[{"cabal_sha256":null,"flags":["-bundled-binary-generic"],"package":"Cabal","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":"714a55fd28d3e2533bd5b49e74f604ef8e5d7b06f249c8816f6c54aed431dcf1","flags":["-optimised-mixer"],"package":"splitmix","revision":0,"source":"hackage","src_sha256":"6d065402394e7a9117093dbb4530a21342c9b1e2ec509516c8a8d0ffed98ecaa","version":"0.1.0.4"},{"cabal_sha256":"8bee24dc0c985a90ee78d94c61f8aed21c49633686f0f1c14c5078d818ee43a2","flags":[],"package":"random","revision":0,"source":"hackage","src_sha256":"265c768fc5f2ca53cde6a87e706b4448cad474c3deece933c103f24453661457","version":"1.2.1"},{"cabal_sha256":"eb6758d0160d607e0c45dbd6b196f515b9a589fd4f6d2f926929dd5d56282d37","flags":[],"package":"base-orphans","revision":0,"source":"hackage","src_sha256":"20a21c4b7adb0fd844b25e196241467406a28286b021f9b7a082ab03fa8015eb","version":"0.8.6"},{"cabal_sha256":"4f6dfb2a191dd3068c2915ba96a1ab3c4b78b4b4e57186698b9ab42007bfa926","flags":[],"package":"ghc-bignum-orphans","revision":0,"source":"hackage","src_sha256":"a4c617c7b90288ba3e24c67633f99e97e11c2367686463b8884d2cd3591241db","version":"0.1.1"},{"cabal_sha256":"2d553c615bfea61a0b0ff7bc208904d009ff57dbd56f211fbae8584c12f432f9","flags":["+containers","+integer-gmp","-random-initial-seed"],"package":"hashable","revision":0,"source":"hackage","src_sha256":"a1af47889e6ddcbe137d625b7d40665930e935eb396aecbf35399862f276e57d","version":"1.4.0.0"},{"cabal_sha256":"b83dec34a53520de84c6dd3dc7aae45d22409b46eb471c478b98108215a370f0","flags":["-bench"],"package":"async","revision":1,"source":"hackage","src_sha256":"484df85be0e76c4fed9376451e48e1d0c6e97952ce79735b72d54297e7e0a725","version":"2.2.4"},{"cabal_sha256":"d8699f46b485f105eea9c7158f3d432ca578e6bbe5d68751184e9899a41d430d","flags":["-old-bytestring","-old-time"],"package":"tar","revision":4,"source":"hackage","src_sha256":"b384449f62b2b0aa3e6d2cb1004b8060b01f21ec93e7b63e7af6d8fad8a9f1de","version":"0.5.1.1"},{"cabal_sha256":"433a5e076aaa8eb3e4158abae78fb409c6bd754e9af99bc2e87583d2bcd8404a","flags":["-devel"],"package":"network","revision":0,"source":"hackage","src_sha256":"f223c08e1c67b1bae4e595dfe87c4873e9f8de7d3f92d0c18e44fd1b2ab01851","version":"3.1.2.5"},{"cabal_sha256":"a16dd922947a6877defe52c4c38d1ab48ed3f85a826930f5d1a568741d619993","flags":[],"package":"th-compat","revision":0,"source":"hackage","src_sha256":"6b5059caf6714f47da92953badf2f556119877e09708c14e206b3ae98b8681c6","version":"0.1.3"},{"cabal_sha256":"a4765164ed0a2d1668446eb2e03460ce98645fbf083598c690846af79b7de10d","flags":[],"package":"network-uri","revision":0,"source":"hackage","src_sha256":"57856db93608a4d419f681b881c9b8d4448800d5a687587dc37e8a9e0b223584","version":"2.6.4.1"},{"cabal_sha256":"6042643c15a0b43e522a6693f1e322f05000d519543a84149cb80aeffee34f71","flags":["-conduit10","-mtl1","+network-uri","-warn-as-error","-warp-tests"],"package":"HTTP","revision":1,"source":"hackage","src_sha256":"d6091c037871ac3d08d021c906206174567499d5a26a6cb804cf530cd590fe2d","version":"4000.3.16"},{"cabal_sha256":"64abad7816ab8cabed8489e29f807b3a6f828e0b2cec0eae404323d69d36df9a","flags":[],"package":"base16-bytestring","revision":0,"source":"hackage","src_sha256":"1d5a91143ef0e22157536093ec8e59d226a68220ec89378d5dcaeea86472c784","version":"1.0.2.0"},{"cabal_sha256":"50ec0e229255d4c45cbdd568da011311b8887f304b931564886016f4984334d8","flags":[],"package":"base64-bytestring","revision":0,"source":"hackage","src_sha256":"fbf8ed30edde271eb605352021431d8f1b055f95a56af31fe2eacf6bdfdc49c9","version":"1.2.1.0"},{"cabal_sha256":"4d33a49cd383d50af090f1b888642d10116e43809f9da6023d9fc6f67d2656ee","flags":[],"package":"edit-distance","revision":1,"source":"hackage","src_sha256":"3e8885ee2f56ad4da940f043ae8f981ee2fe336b5e8e4ba3f7436cff4f526c4a","version":"0.2.2.1"},{"cabal_sha256":null,"flags":["-debug-conflict-sets","-debug-expensive-assertions","-debug-tracetree"],"package":"cabal-install-solver","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":"188d0b5a0491e8b686b32d9b144c9287760ba333d2509bf3f17e3d846fbc2332","flags":["-exe","+use-cbits"],"package":"cryptohash-sha256","revision":0,"source":"hackage","src_sha256":"73a7dc7163871a80837495039a099967b11f5c4fe70a118277842f7a713c6bf6","version":"0.11.102.1"},{"cabal_sha256":"ccce771562c49a2b29a52046ca68c62179e97e8fbeacdae32ca84a85445e8f42","flags":["-example"],"package":"echo","revision":0,"source":"hackage","src_sha256":"c9fe1bf2904825a65b667251ec644f197b71dc5c209d2d254be5de3d496b0e43","version":"0.1.4"},{"cabal_sha256":"fb98b08de467d51f788f8bd9391f0e9ab9bd4d8dfc264296b895ffea0d822dfa","flags":["+no-donna","+test-doctests","+test-hlint","+test-properties"],"package":"ed25519","revision":3,"source":"hackage","src_sha256":"d8a5958ebfa9309790efade64275dc5c441b568645c45ceed1b0c6ff36d6156d","version":"0.0.5.0"},{"cabal_sha256":"2db49b6cb6632a46ec446fc51870cd0d49e0a66d1c5d2063f46ae52a100eb856","flags":["+ofd-locking"],"package":"lukko","revision":1,"source":"hackage","src_sha256":"a80efb60cfa3dae18682c01980d76d5f7e413e191cd186992e1bf7388d48ab1f","version":"0.1.1.3"},{"cabal_sha256":"262a93dbf370be59f4ee57f3b1a51b338bc2c309797daa37c14f2262ae61dae4","flags":["-bundled-c-zlib","-non-blocking-ffi","-pkg-config"],"package":"zlib","revision":1,"source":"hackage","src_sha256":"807f6bddf9cb3c517ce5757d991dde3c7e319953a22c86ee03d74534bd5abc88","version":"0.6.2.3"},{"cabal_sha256":"ae6cdda307237c0b7efeebfb0bf23ff8a26c30f5ba295dce5e4f81ef6e63fff6","flags":["+base48","+lukko","-mtl21","-old-directory","+use-network-uri"],"package":"hackage-security","revision":8,"source":"hackage","src_sha256":"9162b473af5a21c1ff32a50b972b9acf51f4c901604a22cf08a2dccac2f82f17","version":"0.6.0.1"},{"cabal_sha256":"2561adac8ce373910948066debe090a22b336b129ba5af18c0332524d16e72ce","flags":[],"package":"regex-base","revision":0,"source":"hackage","src_sha256":"7b99408f580f5bb67a1c413e0bc735886608251331ad36322020f2169aea2ef1","version":"0.94.0.2"},{"cabal_sha256":"b6421e5356766b0c0a78b6094ae2e3a6259b42c147b717283c03c1cb09163dca","flags":["-_regex-posix-clib"],"package":"regex-posix","revision":0,"source":"hackage","src_sha256":"c7827c391919227711e1cff0a762b1678fd8739f9c902fc183041ff34f59259c","version":"0.96.0.1"},{"cabal_sha256":"25c6e802dc342307e78e5e60433f5e20d03aa783b08b009a399100eb9b6ec529","flags":[],"package":"resolv","revision":3,"source":"hackage","src_sha256":"81a2bafad484db123cf8d17a02d98bb388a127fd0f822fa022589468a0e64671","version":"0.1.2.0"},{"cabal_sha256":null,"flags":["+lukko","+native-dns"],"package":"cabal-install","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"},{"cabal_sha256":null,"flags":["+lukko","+native-dns"],"package":"cabal-install","revision":null,"source":"local","src_sha256":null,"version":"3.7.0.0"}]}
\ No newline at end of file diff --git a/repo/cabal/cabal.project.freeze b/repo/cabal/cabal.project.freeze deleted file mode 100644 index 07c927e..0000000 --- a/repo/cabal/cabal.project.freeze +++ /dev/null @@ -1,65 +0,0 @@ -active-repositories: hackage.haskell.org:merge -constraints: any.Cabal ==3.6.2.0, - Cabal -bundled-binary-generic, - any.HTTP ==4000.3.16, - HTTP -conduit10 -mtl1 +network-uri -warn-as-error -warp-tests, - any.array ==0.5.4.0, - any.async ==2.2.4, - async -bench, - any.base ==4.15.0.0, - any.base-orphans ==0.8.6, - any.base16-bytestring ==1.0.2.0, - any.base64-bytestring ==1.2.1.0, - any.binary ==0.8.8.0, - any.bytestring ==0.10.12.1, - cabal-install -debug-conflict-sets -debug-expensive-assertions -debug-tracetree +lukko +native-dns, - any.containers ==0.6.4.1, - any.cryptohash-sha256 ==0.11.102.1, - cryptohash-sha256 -exe +use-cbits, - any.deepseq ==1.4.5.0, - any.directory ==1.3.6.1, - any.echo ==0.1.4, - echo -example, - any.ed25519 ==0.0.5.0, - ed25519 +no-donna +test-doctests +test-hlint +test-properties, - any.edit-distance ==0.2.2.1, - any.filepath ==1.4.2.1, - any.ghc-bignum ==1.0, - any.ghc-bignum-orphans ==0.1.1, - any.ghc-boot-th ==9.0.1, - any.ghc-prim ==0.7.0, - any.hackage-security ==0.6.0.1, - hackage-security +base48 +lukko -mtl21 -old-directory +use-network-uri, - any.hashable ==1.4.0.0, - hashable +containers +integer-gmp -random-initial-seed, - any.hsc2hs ==0.68.8, - hsc2hs -in-ghc-tree, - any.lukko ==0.1.1.3, - lukko +ofd-locking, - any.mtl ==2.2.2, - any.network ==3.1.2.5, - network -devel, - any.network-uri ==2.6.4.1, - any.parsec ==3.1.14.0, - any.pretty ==1.1.3.6, - any.process ==1.6.11.0, - any.random ==1.2.1, - any.regex-base ==0.94.0.2, - any.regex-posix ==0.96.0.1, - regex-posix -_regex-posix-clib, - any.resolv ==0.1.2.0, - any.rts ==1.0, - any.splitmix ==0.1.0.4, - splitmix -optimised-mixer, - any.stm ==2.5.0.0, - any.tar ==0.5.1.1, - tar -old-bytestring -old-time, - any.template-haskell ==2.17.0.0, - any.text ==1.2.4.1, - any.th-compat ==0.1.3, - any.time ==1.9.3, - any.transformers ==0.5.6.2, - any.unix ==2.7.2.2, - any.zlib ==0.6.2.3, - zlib -bundled-c-zlib -non-blocking-ffi -pkg-config -index-state: hackage.haskell.org 2021-11-17T20:47:55Z diff --git a/repo/cabal/cabal.xibuild b/repo/cabal/cabal.xibuild deleted file mode 100644 index 501b0e3..0000000 --- a/repo/cabal/cabal.xibuild +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -NAME="cabal" -DESC="The Haskell Cabal" - -MAKEDEPS="cabal-stage0" -DEPS="gmp libffi musl zlib " - -PKG_VER=3.6.2.0 -SOURCE="https://hackage.haskell.org/package/cabal-install-$PKG_VER/cabal-install-$PKG_VER.tar.gz" -ADDITIONAL="cabal.project.freeze " - - -prepare () { - export cabal_home="$BUILD_ROOT/dist" - - ln -sf cabal.project.freeze \ - "cabal.project.freeze" -} - -build () { - HOME="$cabal_home" cabal v2-update - HOME="$cabal_home" cabal v2-build all \ - --allow-newer \ - --jobs=${JOBS:-1} \ - --prefix=/usr \ - --docdir=/usr/share/doc/cabal \ - --sysconfdir=/etc -} - -package () { - HOME="$cabal_home" cabal list-bin --allow-newer all:exes | \ - xargs install -Dm755 -t "$PKG_DEST"/usr/bin - - mkdir -p "$PKG_DEST"/usr/share/man/man1 - HOME="$cabal_home" cabal man --raw \ - > "$PKG_DEST"/usr/share/man/man1/cabal.1 - - install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal/LICENSE" -} diff --git a/repo/catch2/catch2.xibuild b/repo/catch2/catch2.xibuild new file mode 100644 index 0000000..f493465 --- /dev/null +++ b/repo/catch2/catch2.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +NAME="catch2" +DESC="A modern, C++-native, header-only, test framework for unit-tests" + +MAKEDEPS="cmake python" + +PKG_VER=2.13.8 +SOURCE="https://github.com/catchorg/Catch2/archive/v$PKG_VER/catch2-v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=TRUE + cmake --build build +} + +check() { + cd build + # ApprovalTests is broken https://github.com/catchorg/Catch2/issues/1780 + CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "ApprovalTests" +} + +package() { + cd $BUILD_ROOT + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/cdparanoia/cdparanoia.xibuild b/repo/cdparanoia/cdparanoia.xibuild new file mode 100644 index 0000000..5ff279f --- /dev/null +++ b/repo/cdparanoia/cdparanoia.xibuild @@ -0,0 +1,41 @@ +#!/bin/sh + +NAME="cdparanoia" +DESC="An audio CD extraction application" + +MAKEDEPS="libtool autoconf automake linux-headers" + +PKG_VER=10.2 +SOURCE="http://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-$PKG_VER.src.tgz" + +ADDITIONAL=" +fix-includes.patch +gcc.patch +no-cuserid.patch +" + + + +prepare() { + apply_patches + + mv configure.guess config.guess + mv configure.sub config.sub + sed -i -e '/configure.\(guess\|sub\)/d' configure.in + aclocal && autoconf + libtoolize +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make -j1 +} + +package() { + make prefix="$PKG_DEST"/usr MANDIR="$PKG_DEST"/usr/share/man install +} + diff --git a/repo/cdparanoia/fix-includes.patch b/repo/cdparanoia/fix-includes.patch new file mode 100644 index 0000000..8d32539 --- /dev/null +++ b/repo/cdparanoia/fix-includes.patch @@ -0,0 +1,7 @@ +--- cdparanoia-III-10.2.orig/utils.h ++++ cdparanoia-III-10.2/utils.h +@@ -1,3 +1,4 @@ ++#include <sys/types.h> + #include <stdlib.h> + #include <endian.h> + #include <stdio.h> diff --git a/repo/cdparanoia/gcc.patch b/repo/cdparanoia/gcc.patch new file mode 100644 index 0000000..d75adfb --- /dev/null +++ b/repo/cdparanoia/gcc.patch @@ -0,0 +1,582 @@ +Index: interface/test_interface.c +=================================================================== +--- a/interface/test_interface.c (Revision 15337) ++++ b/interface/test_interface.c (Revision 15340) +@@ -66,9 +66,9 @@ + if(!fd)fd=fdopen(d->cdda_fd,"r"); + + if(begin<lastread) +- d->private->last_milliseconds=20; ++ d->private_data->last_milliseconds=20; + else +- d->private->last_milliseconds=sectors; ++ d->private_data->last_milliseconds=sectors; + + #ifdef CDDA_TEST_UNDERRUN + sectors-=1; +Index: interface/cdda_interface.h +=================================================================== +--- a/interface/cdda_interface.h (Revision 15337) ++++ b/interface/cdda_interface.h (Revision 15340) +@@ -84,7 +84,7 @@ + int is_atapi; + int is_mmc; + +- cdda_private_data_t *private; ++ cdda_private_data_t *private_data; + void *reserved; + unsigned char inqbytes[4]; + +Index: interface/interface.c +=================================================================== +--- a/interface/interface.c (Revision 15337) ++++ b/interface/interface.c (Revision 15340) +@@ -39,9 +39,9 @@ + if(d->drive_model)free(d->drive_model); + if(d->cdda_fd!=-1)close(d->cdda_fd); + if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->private_data){ ++ if(d->private_data->sg_hd)free(d->private_data->sg_hd); ++ free(d->private_data); + } + + free(d); +@@ -127,7 +127,7 @@ + } + } + } +- if(ms)*ms=d->private->last_milliseconds; ++ if(ms)*ms=d->private_data->last_milliseconds; + return(sectors); + } + +Index: interface/scsi_interface.c +=================================================================== +--- a/interface/scsi_interface.c (Revision 15337) ++++ b/interface/scsi_interface.c (Revision 15340) +@@ -15,13 +15,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->private_data->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->private_data->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +@@ -96,7 +96,7 @@ + static void clear_garbage(cdrom_drive *d){ + fd_set fdset; + struct timeval tv; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->private_data->sg_hd; + int flag=0; + + /* clear out any possibly preexisting garbage */ +@@ -185,7 +185,7 @@ + struct timespec tv2; + int tret1,tret2; + int status = 0; +- struct sg_header *sg_hd=d->private->sg_hd; ++ struct sg_header *sg_hd=d->private_data->sg_hd; + long writebytes=SG_OFF+cmd_len+in_size; + + /* generic scsi device services */ +@@ -195,7 +195,7 @@ + + memset(sg_hd,0,sizeof(sg_hd)); + memset(sense_buffer,0,SG_MAX_SENSE); +- memcpy(d->private->sg_buffer,cmd,cmd_len+in_size); ++ memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size); + sg_hd->twelve_byte = cmd_len == 12; + sg_hd->result = 0; + sg_hd->reply_len = SG_OFF + out_size; +@@ -209,7 +209,7 @@ + tell if the command failed. Scared yet? */ + + if(bytecheck && out_size>in_size){ +- memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); ++ memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); + /* the size does not remove cmd_len due to the way the kernel + driver copies buffers */ + writebytes+=(out_size-in_size); +@@ -243,7 +243,7 @@ + } + + sigprocmask (SIG_BLOCK, &(d->sigset), NULL ); +- tret1=clock_gettime(d->private->clock,&tv1); ++ tret1=clock_gettime(d->private_data->clock,&tv1); + errno=0; + status = write(d->cdda_fd, sg_hd, writebytes ); + +@@ -289,7 +289,7 @@ + } + } + +- tret2=clock_gettime(d->private->clock,&tv2); ++ tret2=clock_gettime(d->private_data->clock,&tv2); + errno=0; + status = read(d->cdda_fd, sg_hd, SG_OFF + out_size); + sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL ); +@@ -313,7 +313,7 @@ + if(bytecheck && in_size+cmd_len<out_size){ + long i,flag=0; + for(i=in_size;i<out_size;i++) +- if(d->private->sg_buffer[i]!=bytefill){ ++ if(d->private_data->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -326,9 +326,9 @@ + + errno=0; + if(tret1<0 || tret2<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; + } + return(0); + } +@@ -347,7 +347,7 @@ + + memset(&hdr,0,sizeof(hdr)); + memset(sense,0,sizeof(sense)); +- memcpy(d->private->sg_buffer,cmd+cmd_len,in_size); ++ memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size); + + hdr.cmdp = cmd; + hdr.cmd_len = cmd_len; +@@ -355,7 +355,7 @@ + hdr.mx_sb_len = SG_MAX_SENSE; + hdr.timeout = 50000; + hdr.interface_id = 'S'; +- hdr.dxferp = d->private->sg_buffer; ++ hdr.dxferp = d->private_data->sg_buffer; + hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ + + /* scary buffer fill hack */ +@@ -400,7 +400,7 @@ + if(bytecheck && in_size<out_size){ + long i,flag=0; + for(i=in_size;i<out_size;i++) +- if(d->private->sg_buffer[i]!=bytefill){ ++ if(d->private_data->sg_buffer[i]!=bytefill){ + flag=1; + break; + } +@@ -412,7 +412,7 @@ + } + + /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */ +- /* d->private->last_milliseconds = hdr.duration; */ ++ /* d->private_data->last_milliseconds = hdr.duration; */ + + errno = 0; + return 0; +@@ -445,9 +445,9 @@ + + handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense); + +- key = d->private->sg_buffer[2] & 0xf; +- ASC = d->private->sg_buffer[12]; +- ASCQ = d->private->sg_buffer[13]; ++ key = d->private_data->sg_buffer[2] & 0xf; ++ ASC = d->private_data->sg_buffer[12]; ++ ASCQ = d->private_data->sg_buffer[13]; + + if(key == 2 && ASC == 4 && ASCQ == 1) return 0; + return 1; +@@ -492,7 +492,7 @@ + if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1); + + { +- unsigned char *b=d->private->sg_buffer; ++ unsigned char *b=d->private_data->sg_buffer; + if(b[0])return(1); /* Handles only up to 256 bytes */ + if(b[6])return(1); /* Handles only up to 256 bytes */ + +@@ -604,8 +604,8 @@ + static unsigned int get_orig_sectorsize(cdrom_drive *d){ + if(mode_sense(d,12,0x01))return(-1); + +- d->orgdens = d->private->sg_buffer[4]; +- return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]); ++ d->orgdens = d->private_data->sg_buffer[4]; ++ return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]); + } + + /* switch CDROM scsi drives to given sector size */ +@@ -664,8 +664,8 @@ + return(-4); + } + +- first=d->private->sg_buffer[2]; +- last=d->private->sg_buffer[3]; ++ first=d->private_data->sg_buffer[2]; ++ last=d->private_data->sg_buffer[3]; + tracks=last-first+1; + + if (last > MAXTRK || first > MAXTRK || last<0 || first<0) { +@@ -683,7 +683,7 @@ + return(-5); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=i; +@@ -704,7 +704,7 @@ + return(-2); + } + { +- scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); ++ scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); + + d->disc_toc[i-first].bFlags=toc->bFlags; + d->disc_toc[i-first].bTrack=0xAA; +@@ -738,7 +738,7 @@ + } + + /* copy to our structure and convert start sector */ +- tracks = d->private->sg_buffer[1]; ++ tracks = d->private_data->sg_buffer[1]; + if (tracks > MAXTRK) { + cderror(d,"003: CDROM reporting illegal number of tracks\n"); + return(-3); +@@ -754,33 +754,33 @@ + return(-5); + } + +- d->disc_toc[i].bFlags = d->private->sg_buffer[10]; ++ d->disc_toc[i].bFlags = d->private_data->sg_buffer[10]; + d->disc_toc[i].bTrack = i + 1; + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- (((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5])); ++ (((signed char)(d->private_data->sg_buffer[2])<<24) | ++ (d->private_data->sg_buffer[3]<<16)| ++ (d->private_data->sg_buffer[4]<<8)| ++ (d->private_data->sg_buffer[5])); + } + + d->disc_toc[i].bFlags = 0; + d->disc_toc[i].bTrack = i + 1; +- memcpy (&foo, d->private->sg_buffer+2, 4); +- memcpy (&bar, d->private->sg_buffer+6, 4); ++ memcpy (&foo, d->private_data->sg_buffer+2, 4); ++ memcpy (&bar, d->private_data->sg_buffer+6, 4); + d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) + + be32_to_cpu(bar)); + + d->disc_toc[i].dwStartSector= d->adjust_ssize * +- ((((signed char)(d->private->sg_buffer[2])<<24) | +- (d->private->sg_buffer[3]<<16)| +- (d->private->sg_buffer[4]<<8)| +- (d->private->sg_buffer[5]))+ ++ ((((signed char)(d->private_data->sg_buffer[2])<<24) | ++ (d->private_data->sg_buffer[3]<<16)| ++ (d->private_data->sg_buffer[4]<<8)| ++ (d->private_data->sg_buffer[5]))+ + +- ((((signed char)(d->private->sg_buffer[6])<<24) | +- (d->private->sg_buffer[7]<<16)| +- (d->private->sg_buffer[8]<<8)| +- (d->private->sg_buffer[9])))); ++ ((((signed char)(d->private_data->sg_buffer[6])<<24) | ++ (d->private_data->sg_buffer[7]<<16)| ++ (d->private_data->sg_buffer[8]<<8)| ++ (d->private_data->sg_buffer[9])))); + + + d->cd_extra = FixupTOC(d,tracks+1); +@@ -817,7 +817,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -836,7 +836,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -854,7 +854,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -872,7 +872,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -890,7 +890,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -908,7 +908,7 @@ + cmd[9] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -922,7 +922,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -936,7 +936,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -950,7 +950,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -964,7 +964,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -978,7 +978,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -992,7 +992,7 @@ + cmd[8] = sectors; + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1026,7 +1026,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1039,7 +1039,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1052,7 +1052,7 @@ + + if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) + return(ret); +- if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); ++ if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); + return(0); + } + +@@ -1275,7 +1275,7 @@ + static int count_2352_bytes(cdrom_drive *d){ + long i; + for(i=2351;i>=0;i--) +- if(d->private->sg_buffer[i]!=(unsigned char)'\177') ++ if(d->private_data->sg_buffer[i]!=(unsigned char)'\177') + return(((i+3)>>2)<<2); + + return(0); +@@ -1284,7 +1284,7 @@ + static int verify_nonzero(cdrom_drive *d){ + long i,flag=0; + for(i=0;i<2352;i++) +- if(d->private->sg_buffer[i]!=0){ ++ if(d->private_data->sg_buffer[i]!=0){ + flag=1; + break; + } +@@ -1621,7 +1621,7 @@ + d->is_mmc=0; + if(mode_sense(d,22,0x2A)==0){ + +- b=d->private->sg_buffer; ++ b=d->private_data->sg_buffer; + b+=b[3]+4; + + if((b[0]&0x3F)==0x2A){ +@@ -1669,7 +1669,7 @@ + cderror(d,"008: Unable to identify CDROM model\n"); + return(NULL); + } +- return (d->private->sg_buffer); ++ return (d->private_data->sg_buffer); + } + + int scsi_init_drive(cdrom_drive *d){ +@@ -1725,8 +1725,8 @@ + check_cache(d); + + d->error_retry=1; +- d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); ++ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; + d->report_all=1; + return(0); + } +Index: interface/cooked_interface.c +=================================================================== +--- a/interface/cooked_interface.c (Revision 15337) ++++ b/interface/cooked_interface.c (Revision 15340) +@@ -13,13 +13,13 @@ + static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ + struct timespec tv1; + struct timespec tv2; +- int ret1=clock_gettime(d->private->clock,&tv1); ++ int ret1=clock_gettime(d->private_data->clock,&tv1); + int ret2=ioctl(fd, command,arg); +- int ret3=clock_gettime(d->private->clock,&tv2); ++ int ret3=clock_gettime(d->private_data->clock,&tv2); + if(ret1<0 || ret3<0){ +- d->private->last_milliseconds=-1; ++ d->private_data->last_milliseconds=-1; + }else{ +- d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; ++ d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; + } + return ret2; + } +Index: interface/scan_devices.c +=================================================================== +--- a/interface/scan_devices.c (Revision 15337) ++++ b/interface/scan_devices.c (Revision 15340) +@@ -264,11 +264,11 @@ + d->interface=COOKED_IOCTL; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); + return(d); +@@ -674,15 +674,15 @@ + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; + d->messagedest = messagedest; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + { + /* goddamnit */ + struct timespec tv; +- d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); ++ d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); + } + if(use_sgio){ + d->interface=SGIO_SCSI; +- d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); ++ d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); + g_fd=d->cdda_fd=dup(d->ioctl_fd); + }else{ + version=verify_SG_version(d,messagedest,messages); +@@ -696,8 +696,8 @@ + } + + /* malloc our big buffer for scsi commands */ +- d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE); +- d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; ++ d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE); ++ d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; + } + + { +@@ -772,9 +772,9 @@ + if(i_fd!=-1)close(i_fd); + if(g_fd!=-1)close(g_fd); + if(d){ +- if(d->private){ +- if(d->private->sg_hd)free(d->private->sg_hd); +- free(d->private); ++ if(d->private_data){ ++ if(d->private_data->sg_hd)free(d->private_data->sg_hd); ++ free(d->private_data); + } + free(d); + } +@@ -821,7 +821,7 @@ + d->interface=TEST_INTERFACE; + d->bigendianp=-1; /* We don't know yet... */ + d->nsectors=-1; +- d->private=calloc(1,sizeof(*d->private)); ++ d->private_data=calloc(1,sizeof(*d->private_data)); + d->drive_model=copystring("File based test interface"); + idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model); + diff --git a/repo/cdparanoia/no-cuserid.patch b/repo/cdparanoia/no-cuserid.patch new file mode 100644 index 0000000..dd6417f --- /dev/null +++ b/repo/cdparanoia/no-cuserid.patch @@ -0,0 +1,32 @@ +Since IEEE 1003.1-1988 cuserid is not standardized anymore. The musl +libc, used by Alpine Linux, currently does not supporting using it with +a NULL pointer argument [1]. Doing so causes a segmentation fault, to +fix this remove use of cuserid entirely. This is currently achieved by +not including the user name in the error message, while it would be +possible to achieve the same output using getpwuid(geteuid()) this +requires error handling and would make the patch more complicated. + +[1]: https://www.openwall.com/lists/musl/2020/01/29/2 + +diff -upr cdparanoia-III-10.2.orig/interface/scan_devices.c cdparanoia-III-10.2/interface/scan_devices.c +--- cdparanoia-III-10.2.orig/interface/scan_devices.c 2020-02-12 20:29:46.232958848 +0100 ++++ cdparanoia-III-10.2/interface/scan_devices.c 2020-02-12 20:30:06.336297868 +0100 +@@ -6,8 +6,6 @@ + * + ******************************************************************/ + +-#define _GNU_SOURCE /* get cuserid */ +-#define _USE_XOPEN /* get cuserid */ + #include <limits.h> + #include <stdio.h> + #include <unistd.h> +@@ -93,8 +91,7 @@ cdrom_drive *cdda_find_a_cdrom(int messa + i++; + } + idmessage(messagedest,messages, +- "\n\nNo cdrom drives accessible to %s found.\n", +- cuserid(NULL)); ++ "\n\nNo cdrom drives accessible to current user found.\n", NULL); + return(NULL); + } + diff --git a/repo/cdrkit/cdrkit.xibuild b/repo/cdrkit/cdrkit.xibuild index ac430d8..a9add1e 100644 --- a/repo/cdrkit/cdrkit.xibuild +++ b/repo/cdrkit/cdrkit.xibuild @@ -3,25 +3,33 @@ NAME="cdrkit" DESC="Suite of programs for CD/DVD recording, ISO image creation, and audio CD extraction" -MAKEDEPS="make " -DEPS="bzip2 file libcap musl zlib " +MAKEDEPS=" cmake libcap bzip2 zlib" PKG_VER=1.1.11 SOURCE="https://dev.alpinelinux.org/archive/cdrkit/cdrkit-$PKG_VER.tar.gz" -ADDITIONAL="gcc10.patch " -prepare () { - sed -i include/xconfig.h.in -e "s/#define HAVE_RCMD 1/#undef HAVE_RCMD/g" +ADDITIONAL=" +gcc10.patch +" + +prepare() { + # disable rcmd, it is security risk and not implemented in musl + sed -i include/xconfig.h.in -e "s/#define HAVE_RCMD 1/#undef HAVE_RCMD/g" apply_patches } -build () { - export CFLAGS="$CFLAGS -D__THROW=''" - make +build() { + export CFLAGS="$CFLAGS -D__THROW=''" + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DBUILD_SHARED_LIBS=True \ + -DBUILD_STATIC_LIBS=OFF + cmake --build build } -package () { - make PREFIX="$PKG_DEST/usr" install +package() { + DESTDIR="$PKG_DEST" cmake --install build cd "$PKG_DEST/usr/bin" ln -s wodim cdrecord ln -s readom readcd @@ -35,3 +43,4 @@ package () { ln -s genisoimage.1 mkhybrid.1 ln -s icedax.1 cdda2wav.1 } + diff --git a/repo/chromaprint/chromaprint.xibuild b/repo/chromaprint/chromaprint.xibuild new file mode 100644 index 0000000..e3f4939 --- /dev/null +++ b/repo/chromaprint/chromaprint.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="chromaprint" +DESC="C library for generating audio fingerprints used by AcoustID" + +MAKEDEPS="cmake fftw ffmpeg4 ninja" + +PKG_VER=1.5.1 +SOURCE="https://github.com/acoustid/chromaprint/archive/v$PKG_VER.tar.gz" + +build() { + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=MinSizeRel \ + -DBUILD_TOOLS=ON . + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/chromium/chromium.xibuild b/repo/chromium/chromium.xibuild index 5131239..a97458a 100644 --- a/repo/chromium/chromium.xibuild +++ b/repo/chromium/chromium.xibuild @@ -131,12 +131,12 @@ prepare () { } build () { - #export CC=clang - #export CXX=clang++ - #export LD=clang++ + export CC=clang + export CXX=clang++ + export LD=clang++ #export AR=ar #export NM=nm - export LDFLAGS="-stdlib=libstdc++" + #export LDFLAGS="-stdlib=libstdc++" flags=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\" @@ -144,7 +144,7 @@ host_toolchain=\"//build/toolchain/linux/unbundle:default\" enable_nacl=false use_sysroot=false gold_path=\"/usr/bin/ld.gold\" -use_custom_libcxx=false +use_custom_libcxx=true use_gold=false is_debug=false blink_symbol_level=0 diff --git a/repo/chrpath/chrpath.xibuild b/repo/chrpath/chrpath.xibuild new file mode 100644 index 0000000..591292b --- /dev/null +++ b/repo/chrpath/chrpath.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +NAME="chrpath" +DESC="Modify rpath of compiled programs" + +MAKEDEPS="" + +PKG_VER=0.16 +SOURCE="https://alioth-archive.debian.org/releases/chrpath/chrpath/$PKG_VER/chrpath-$PKG_VER.tar.gz" + +build() { + cd "$BUILD_ROOT" + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var + make +} + +check() { + cd "$BUILD_ROOT" + make check +} + +package() { + cd "$BUILD_ROOT" + make DESTDIR="$PKG_DEST" docdir=/usr/share/doc/chrpath-$PKG_VER \ + install +} + diff --git a/repo/cmark/cmark.xibuild b/repo/cmark/cmark.xibuild new file mode 100644 index 0000000..a9e4f44 --- /dev/null +++ b/repo/cmark/cmark.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="cmark" +DESC="C reference implementation of CommonMark, a rationalized Markdown spec" + +MAKEDEPS=" cmake re2c" + +PKG_VER=0.30.2 +SOURCE="https://github.com/commonmark/cmark/archive/$PKG_VER/cmark-$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib + cmake --build build +} + +check() { + cd build + CTEST_OUTPUT_ON_FAILURE=TRUE ctest + cd $BUILD_ROOT +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/coeurl/coeurl.xibuild b/repo/coeurl/coeurl.xibuild new file mode 100644 index 0000000..44bf01c --- /dev/null +++ b/repo/coeurl/coeurl.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="coeurl" +DESC="Asynchronous wrapper around libcurl" + +MAKEDEPS=" cmake curl libevent meson spdlog" + +PKG_VER=0.2.0 +SOURCE="https://nheko.im/nheko-reborn/coeurl/-/archive/v$PKG_VER/coeurl-v$PKG_VER.tar.bz2" + +build() { + meson --prefix=/usr \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +check() { + meson test --no-rebuild -v -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + diff --git a/repo/cppzmq/cppzmq.xibuild b/repo/cppzmq/cppzmq.xibuild new file mode 100644 index 0000000..1fbe0ee --- /dev/null +++ b/repo/cppzmq/cppzmq.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="cppzmq" +DESC="High-level C++ binding for ZeroMQ" + +MAKEDEPS="cmake zeromq catch2" + +PKG_VER=4.8.1 +SOURCE="https://github.com/zeromq/cppzmq/archive/v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DCPPZMQ_BUILD_TESTS=OFF \ + $CMAKE_CROSSOPTS . + make -C build +} + +package() { + cd $BUILD_ROOT + make -C build DESTDIR="$PKG_DEST" install + + mkdir -p "$PKG_DEST"/usr/lib + mv "$PKG_DEST"/usr/share/cmake "$PKG_DEST"/usr/lib +} + diff --git a/repo/dwm/dwm.xibuild b/repo/dwm/dwm.xibuild index 9644344..a1c0853 100644 --- a/repo/dwm/dwm.xibuild +++ b/repo/dwm/dwm.xibuild @@ -4,7 +4,7 @@ NAME="dwm" DESC="dwm - dynamic window manager" MAKEDEPS=" libxft libx11 libxinerama" -DEPS="sxmo-demenu st" +DEPS="dmenu st" PKG_VER=6.3 SOURCE="https://dl.suckless.org/dwm/dwm-$PKG_VER.tar.gz" diff --git a/repo/fmt/fmt.xibuild b/repo/fmt/fmt.xibuild index 5c17a60..acaa5b8 100644 --- a/repo/fmt/fmt.xibuild +++ b/repo/fmt/fmt.xibuild @@ -1,17 +1,29 @@ #!/bin/sh -MAKEDEPS="make" -DEPS="musl sh" +NAME="fmt" +DESC="Open-source formatting library for C++" -PKG_VER=0.8.6 -SOURCE=http://landley.net/toybox/downloads/toybox-$PKG_VER.tar.gz -DESC="fmt from toybox" +MAKEDEPS="cmake doxygen python ninja" -build () { - ./configure - make fmt +PKG_VER=8.1.1 +SOURCE="https://github.com/fmtlib/fmt/releases/download/$PKG_VER/fmt-$PKG_VER.zip" + +build() { + cmake -B . -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + $CMAKE_CROSSOPTS + cmake --build . +} + +check() { + CTEST_OUTPUT_ON_FAILURE=TRUE ctest } -package () { - install -Dm755 fmt $PKG_DEST/usr/bin/ +package() { + DESTDIR="$PKG_DEST" cmake --install . } + diff --git a/repo/gcovr/gcovr.xibuild b/repo/gcovr/gcovr.xibuild index e7b186d..20c5988 100644 --- a/repo/gcovr/gcovr.xibuild +++ b/repo/gcovr/gcovr.xibuild @@ -12,10 +12,6 @@ build() { python3 setup.py build } -check() { - py.test-3 -v gcovr -} - package() { python3 setup.py install --prefix=/usr --root="$PKG_DEST" } diff --git a/repo/gflags/gflags.xibuild b/repo/gflags/gflags.xibuild new file mode 100644 index 0000000..1f692dd --- /dev/null +++ b/repo/gflags/gflags.xibuild @@ -0,0 +1,29 @@ +#!/bin/sh + +NAME="gflags" +DESC="The gflags package contains a C++ library that implements commandline flags processing." + +MAKEDEPS="cmake" + +PKG_VER=2.2.2 +SOURCE="https://github.com/gflags/gflags/archive/v$PKG_VER.tar.gz" + +build() { + cmake -B build . \ + -DCMAKE_BUILD_TYPE=None \ + -DBUILD_STATIC_LIBS=ON \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_TESTING=ON \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DREGISTER_INSTALL_PREFIX=OFF + make -C build +} + +check() { + make -C build test +} + +package() { + make -C build DESTDIR="$PKG_DEST" install +} + diff --git a/repo/ghostscript/ghostscript.xibuild b/repo/ghostscript/ghostscript.xibuild index ed06538..7d4152a 100644 --- a/repo/ghostscript/ghostscript.xibuild +++ b/repo/ghostscript/ghostscript.xibuild @@ -3,7 +3,7 @@ NAME="ghostscript" DESC="An interpreter for the PostScript language and for PDF" -MAKEDEPS="make freetype openjpeg libpng zlib tiff cups jbig2dec" +MAKEDEPS="make freetype2 openjpeg libpng zlib tiff cups jbig2dec" DEPS="musl " PKG_VER=9.56.1 @@ -23,7 +23,6 @@ prepare () { cd $BUILD_ROOT/ijs libtoolize --force && aclocal && autoconf && automake --add-missing - update_config_sub } build () { diff --git a/repo/glade/duplicate-linguas.patch b/repo/glade/duplicate-linguas.patch deleted file mode 100644 index 4d2ab18..0000000 --- a/repo/glade/duplicate-linguas.patch +++ /dev/null @@ -1,9 +0,0 @@ ---- a/help/LINGUAS -+++ b/help/LINGUAS -@@ -1,6 +1,5 @@ - # please keep this list sorted alphabetically - # --da - bg - ca - cs diff --git a/repo/glade/glade.xibuild b/repo/glade/glade.xibuild deleted file mode 100644 index f043951..0000000 --- a/repo/glade/glade.xibuild +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -NAME="glade" -DESC="User Interface Designer for GTK+ and GNOME" - -MAKEDEPS="gtk3 libxml2 itstool intltool python-gobject gobject-introspection meson python gjs" - -PKG_VER=3.38.2 -SOURCE="https://download.gnome.org/sources/glade/${PKG_VER%.*}/glade-$PKG_VER.tar.xz" - -ADDITIONAL=" -duplicate-linguas.patch -meson-0.60.patch -" - -prepare () { - apply_patches -} - -build() { - meson --prefix=/usr \ - . output - meson compile ${JOBS:+-j ${JOBS}} -C output -} - -package() { - # this one index is missing, so copy it from another language - mkdir output/help/hi/ - cp output/help/en_GB/index.docbook output/help/hi/index.docbook - - DESTDIR="$PKG_DEST" meson install --no-rebuild -C output -} diff --git a/repo/glade/meson-0.60.patch b/repo/glade/meson-0.60.patch deleted file mode 100644 index d470a31..0000000 --- a/repo/glade/meson-0.60.patch +++ /dev/null @@ -1,18 +0,0 @@ ---- a/data/meson.build -+++ b/data/meson.build -@@ -2,7 +2,6 @@ - desktop_conf.set('VERSION', glade_version) - - i18n.merge_file( -- 'desktop', - type: 'desktop', - input: configure_file( - input: 'org.gnome.Glade.desktop.in.in', -@@ -18,7 +17,6 @@ - appdata = glade_name + '.appdata.xml' - - i18n.merge_file( -- 'appdata', - input: 'org.gnome.Glade.appdata.xml.in', - output: '@BASENAME@', - po_dir: po_dir, diff --git a/repo/graphene/0001-meson-don-t-install-introspection-file-with-installe.patch b/repo/graphene/0001-meson-don-t-install-introspection-file-with-installe.patch new file mode 100644 index 0000000..a760553 --- /dev/null +++ b/repo/graphene/0001-meson-don-t-install-introspection-file-with-installe.patch @@ -0,0 +1,29 @@ +Patch-Source: https://github.com/ebassi/graphene/pull/248 +From 85289fa63b1a5e4e5a03a79b947d1db5b9ec4778 Mon Sep 17 00:00:00 2001 +From: psykose <alice@ayaya.dev> +Date: Thu, 7 Apr 2022 19:01:49 +0000 +Subject: [PATCH] meson: don't install introspection file with + installed_tests=false + +--- + tests/meson.build | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/tests/meson.build b/tests/meson.build +index 0a6a355..0120c29 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -67,7 +67,9 @@ src_build_path = meson.current_build_dir() / '../src' + + if build_gir and host_system == 'linux' and not meson.is_cross_build() + foreach unit: ['introspection.py'] +- install_data(unit, install_dir: installed_test_bindir) ++ if get_option('installed_tests') ++ install_data(unit, install_dir: installed_test_bindir) ++ endif + + wrapper = '@0@.test'.format(unit) + custom_target(wrapper, +-- +2.35.1 + diff --git a/repo/graphene/graphene.xibuild b/repo/graphene/graphene.xibuild new file mode 100644 index 0000000..edc040e --- /dev/null +++ b/repo/graphene/graphene.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +NAME="graphene" +DESC="A thin layer of graphic data types" + +MAKEDEPS="meson glib gobject-introspection" + +PKG_VER=1.10.8 +SOURCE="https://github.com/ebassi/graphene/archive/$PKG_VER/graphene-$PKG_VER.tar.gz" + +ADDITIONAL=" +0001-meson-don-t-install-introspection-file-with-installe.patch +" + +prepare () { + apply_patches +} + +build() { + meson --prefix=/usr \ + -Darm_neon=true \ + -Dinstalled_tests=false \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +check() { + meson test --no-rebuild -v -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + diff --git a/repo/gsm/gsm-64bit.patch b/repo/gsm/gsm-64bit.patch new file mode 100644 index 0000000..195ed31 --- /dev/null +++ b/repo/gsm/gsm-64bit.patch @@ -0,0 +1,15 @@ +--- gsm-1.0-pl12/inc/private.h.64bit 2006-04-26 21:17:01.000000000 +0200 ++++ gsm-1.0-pl12/inc/private.h 2007-05-11 00:25:23.000000000 +0200 +@@ -10,10 +10,10 @@ + #define PRIVATE_H + + typedef short word; /* 16 bit signed int */ +-typedef long longword; /* 32 bit signed int */ ++typedef int longword; /* 32 bit signed int */ + + typedef unsigned short uword; /* unsigned word */ +-typedef unsigned long ulongword; /* unsigned longword */ ++typedef unsigned int ulongword; /* unsigned longword */ + + struct gsm_state { + diff --git a/repo/gsm/gsm-makefile.patch b/repo/gsm/gsm-makefile.patch new file mode 100644 index 0000000..b11e150 --- /dev/null +++ b/repo/gsm/gsm-makefile.patch @@ -0,0 +1,115 @@ +--- gsm-1.0-pl12/Makefile.mk 2006-04-26 21:14:26.000000000 +0200 ++++ gsm-1.0-pl12/Makefile 2007-05-13 13:03:32.000000000 +0200 +@@ -30,6 +30,10 @@ + ######### define this, and read about the GSM_OPT_WAV49 option in the + ######### manual page on gsm_option(3). + ++PG = ++#PG = -g -pg ++######### Profiling flags. If you don't know what that means, leave it blank ++ + # Choose a compiler. The code works both with ANSI and K&R-C. + # Use -DNeedFunctionPrototypes to compile with, -UNeedFunctionPrototypes to + # compile without, function prototypes in the header files. +@@ -44,7 +48,7 @@ + # CCFLAGS = -c -O + + CC = gcc -ansi -pedantic +-CCFLAGS = -c -O2 -DNeedFunctionPrototypes=1 -Wall -Wno-comment ++CCFLAGS = -c $(RPM_OPT_FLAGS) -D_REENTRANT -DNeedFunctionPrototypes=1 + + LD = $(CC) + +@@ -81,7 +85,7 @@ + GSM_INSTALL_ROOT = $(INSTALL_ROOT) + GSM_INSTALL_LIB = $(GSM_INSTALL_ROOT)/lib + GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/inc +-GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/man/man3 ++GSM_INSTALL_MAN = $(GSM_INSTALL_ROOT)/share/man/man3 + + + # Where do you want to install the toast binaries and their manpage? +@@ -91,16 +95,16 @@ + + TOAST_INSTALL_ROOT = $(INSTALL_ROOT) + TOAST_INSTALL_BIN = $(TOAST_INSTALL_ROOT)/bin +-TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/man/man1 ++TOAST_INSTALL_MAN = $(TOAST_INSTALL_ROOT)/share/man/man1 + + # Other tools + + SHELL = /bin/sh +-LN = ln ++LN = ln -s + BASENAME = basename + AR = ar + ARFLAGS = cr +-RMFLAGS = ++RMFLAGS = -f + FIND = find + COMPRESS = compress + COMPRESSFLAGS = +@@ -129,17 +133,18 @@ + # DEBUG = -DNDEBUG + ######### Remove -DNDEBUG to enable assertions. + +-CFLAGS = $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \ ++CFLAGS = $(PG) $(CCFLAGS) $(SASR) $(DEBUG) $(MULHACK) $(FAST) $(LTP_CUT) \ + $(WAV49) $(CCINC) -I$(INC) + ######### It's $(CC) $(CFLAGS) + +-LFLAGS = $(LDFLAGS) $(LDINC) ++LFLAGS = $(PG) $(LDFLAGS) $(LDINC) + ######### It's $(LD) $(LFLAGS) + + + # Targets + + LIBGSM = $(LIB)/libgsm.a ++LIBGSMSO = $(LIB)/libgsm.so + + TOAST = $(BIN)/toast + UNTOAST = $(BIN)/untoast +@@ -279,7 +284,7 @@ + + # Target rules + +-all: $(LIBGSM) $(TOAST) $(TCAT) $(UNTOAST) ++all: $(LIBGSM) $(LIBGSMSO) $(TOAST) $(TCAT) $(UNTOAST) + @-echo $(ROOT): Done. + + tst: $(TST)/lin2cod $(TST)/cod2lin $(TOAST) $(TST)/test-result +@@ -299,24 +304,28 @@ + + # The basic API: libgsm + ++$(LIBGSMSO): $(LIB) $(GSM_OBJECTS) ++ $(LD) -o $@.1.0.12 -shared -Xlinker -soname -Xlinker libgsm.so.1 $(GSM_OBJECTS) -lc ++ ln -fs libgsm.so.1.0.12 lib/libgsm.so.1 ++ ln -fs libgsm.so.1.0.12 lib/libgsm.so ++ + $(LIBGSM): $(LIB) $(GSM_OBJECTS) + -rm $(RMFLAGS) $(LIBGSM) + $(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS) + $(RANLIB) $(LIBGSM) + +- + # Toast, Untoast and Tcat -- the compress-like frontends to gsm. + +-$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) +- $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSM) $(LDLIB) ++$(TOAST): $(BIN) $(TOAST_OBJECTS) $(LIBGSM) $(LIBGSMSO) ++ $(LD) $(LFLAGS) -o $(TOAST) $(TOAST_OBJECTS) $(LIBGSMSO) $(LDLIB) + + $(UNTOAST): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(UNTOAST) +- $(LN) $(TOAST) $(UNTOAST) ++ $(LN) toast $(UNTOAST) + + $(TCAT): $(BIN) $(TOAST) + -rm $(RMFLAGS) $(TCAT) +- $(LN) $(TOAST) $(TCAT) ++ $(LN) toast $(TCAT) + + + # The local bin and lib directories diff --git a/repo/gsm/gsm.xibuild b/repo/gsm/gsm.xibuild new file mode 100644 index 0000000..e5e12cd --- /dev/null +++ b/repo/gsm/gsm.xibuild @@ -0,0 +1,44 @@ +#!/bin/sh + +NAME="gsm" +DESC="Shared libraries for GSM speech compressor" + +MAKEDEPS="" + +PKG_VER=1.0.19 +SOURCE="http://www.quut.com/gsm/gsm-$PKG_VER.tar.gz" + +ADDITIONAL=" +gsm-64bit.patch +gsm-makefile.patch +" +_soname=1.0.12 + +build() { + export RPM_OPT_FLAGS="$CFLAGS -fPIC" + make all +} + +check() { + make addtst +} + +package() { + mkdir -p "$PKG_DEST"/usr/bin \ + "$PKG_DEST"/usr/include/gsm \ + "$PKG_DEST"/usr/lib \ + "$PKG_DEST"/usr/share/man/man1 \ + "$PKG_DEST"/usr/share/man/man3 + + make -j1 install \ + INSTALL_ROOT="$PKG_DEST"/usr \ + GSM_INSTALL_INC="$PKG_DEST"/usr/include/gsm \ + GSM_INSTALL_LIB="$PKG_DEST"/usr/lib + cp -p lib/libgsm.so.$_soname "$PKG_DEST"/usr/lib/ + ln -s libgsm.so.$_soname "$PKG_DEST"/usr/lib/libgsm.so.1 + ln -s libgsm.so.$_soname "$PKG_DEST"/usr/lib/libgsm.so + + ln -s gsm/gsm.h "$PKG_DEST"/usr/include/ + rm -f "$PKG_DEST"/usr/lib/lib*.a +} + diff --git a/repo/gst-plugins-bad/gst-plugins-bad.xibuild b/repo/gst-plugins-bad/gst-plugins-bad.xibuild new file mode 100644 index 0000000..ae856de --- /dev/null +++ b/repo/gst-plugins-bad/gst-plugins-bad.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="gst-plugins-bad" +DESC="GStreamer streaming media framework bad plug-ins" + +MAKEDEPS="alsa-lib aom bluez bzip2 curl faac faad2 flite glib glu gst-plugins-base gstreamer libass libdc1394 libmms libgudev libmodplug libsrtp libvdpau libwebp libnice libx11 mesa meson neon openssl opus orc-compiler orc spandsp tiff x265 wayland wayland-protocols gobject-introspection libusrsctp lcms2 pango chromaprint fdk-aac fluidsynth libde265 openal-soft openexr openjpeg libdvdnav libdvdread sbc libsndfile soundtouch libxkbcommon gtk3 rtmpdump vo-aacenc vo-amrwbenc librsvg libexif" + +PKG_VER=1.20.1 +SOURCE="https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-$PKG_VER.tar.xz" + +build() { + meson --prefix=/usr \ + -Dintrospection=enabled \ + -Dsctp=enabled \ + -Dtests="disabled" \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + diff --git a/repo/gst-plugins-base/gst-plugins-base.xibuild b/repo/gst-plugins-base/gst-plugins-base.xibuild new file mode 100644 index 0000000..8675b16 --- /dev/null +++ b/repo/gst-plugins-base/gst-plugins-base.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="gst-plugins-base" +DESC="GStreamer streaming media framework base plug-ins" + +MAKEDEPS="alsa-lib cdparanoia expat glib gobject-introspection graphene gstreamer gtk3 libice libogg libsm libtheora libvorbis libxv mesa meson opus orc-compiler orc perl" + +PKG_VER=1.20.1 +SOURCE="https://gstreamer.freedesktop.org/src/gst-plugins-base/gst-plugins-base-$PKG_VER.tar.xz" + +build() { + meson --prefix=/usr \ + -Dalsa=enabled \ + -Dintrospection=enabled \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + diff --git a/repo/gstreamer/gstreamer.xibuild b/repo/gstreamer/gstreamer.xibuild new file mode 100644 index 0000000..d8b3f46 --- /dev/null +++ b/repo/gstreamer/gstreamer.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="gstreamer" +DESC="GStreamer streaming media framework" + +MAKEDEPS="libxml2 bison flex glib gobject-introspection libcap meson perl" + +PKG_VER=1.20.1 +SOURCE="https://gstreamer.freedesktop.org/src/gstreamer/gstreamer-$PKG_VER.tar.xz" + +build() { + meson --prefix=/usr \ + -Dintrospection=enabled \ + -Dbash-completion=disabled \ + -Dptp-helper-permissions=capabilities \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} diff --git a/repo/gtkmm2/gtkmm2.xibuild b/repo/gtkmm2/gtkmm2.xibuild new file mode 100644 index 0000000..8ba6f90 --- /dev/null +++ b/repo/gtkmm2/gtkmm2.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +NAME="gtkmm2" +DESC="C++ wrappers for GTK+" + +MAKEDEPS="atkmm glibmm pangomm intltool gtk2" + +PKG_VER=2.24.5 +SOURCE="https://download.gnome.org/sources/gtkmm/${PKG_VER%.*}/gtkmm-$PKG_VER.tar.xz" + +build() { + CXXFLAGS="$CXXFLAGS -std=c++11" \ + ./configure \ + --prefix=/usr + make +} + +package() { + make install DESTDIR="$PKG_DEST" +} diff --git a/repo/hidapi/autoconf-270.patch b/repo/hidapi/autoconf-270.patch new file mode 100644 index 0000000..e9a24bb --- /dev/null +++ b/repo/hidapi/autoconf-270.patch @@ -0,0 +1,15 @@ +Upstream: Should be +Reason: Fixes regenerating with autoconf270 + +diff --git a/configure.ac b/configure.ac +index b9f670e..b1695ad 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -18,7 +18,6 @@ lt_revision="0" + lt_age="0" + LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}" + +-AC_CONFIG_MACRO_DIR([m4]) + AM_INIT_AUTOMAKE([foreign -Wall -Werror]) + AC_CONFIG_MACRO_DIR([m4]) + diff --git a/repo/hidapi/hidapi.xibuild b/repo/hidapi/hidapi.xibuild new file mode 100644 index 0000000..0224d4f --- /dev/null +++ b/repo/hidapi/hidapi.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +NAME="hidapi" +DESC="Simple library for communicating with USB and Bluetooth HID devices" + +MAKEDEPS=" cmake eudev libusb linux-headers" + +PKG_VER=0.11.2 +SOURCE="https://github.com/libusb/hidapi/archive/hidapi-$PKG_VER/hidapi-$PKG_VER.tar.gz" + +ADDITIONAL=" +autoconf-270.patch +" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/highway/highway.xibuild b/repo/highway/highway.xibuild new file mode 100644 index 0000000..ac29d76 --- /dev/null +++ b/repo/highway/highway.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="highway" +DESC="Performance-portable, length-agnostic SIMD with runtime dispatch" + +MAKEDEPS="" + +PKG_VER=0.16.0 +SOURCE="https://github.com/google/highway/archive/$PKG_VER/highway-$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr + + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/i3wm/i3wm.xibuild b/repo/i3wm/i3wm.xibuild index db71c03..6e289c1 100644 --- a/repo/i3wm/i3wm.xibuild +++ b/repo/i3wm/i3wm.xibuild @@ -3,7 +3,7 @@ NAME="i3wm" DESC="Improved dynamic tiling window manager" -MAKEDEPS=" meson bash bison cairo flex libev libxcb libxkbcommon pango pcre perl startup-notification xcb-util-cursor xcb-util-keysyms xcb-util-wm xcb-util-xrm yajl" +MAKEDEPS=" meson bash bison cairo flex libev libxcb libxkbcommon pango pcre perl startup-notification xcb-util-cursor xcb-util-keysyms xcb-util-wm xcb-util-xrm yajl xcb-util-renderutil xcb-util-image" PKG_VER=4.20.1 SOURCE="https://i3wm.org/downloads/i3-$PKG_VER.tar.xz" diff --git a/repo/icewm/icewm.xibuild b/repo/icewm/icewm.xibuild deleted file mode 100644 index 3ecdf11..0000000 --- a/repo/icewm/icewm.xibuild +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -NAME="icewm" -DESC="Window manager designed for speed, usability and consistency" - -MAKEDEPS=" alsa-lib asciidoctor cmake fribidi glib imlib2 libao libintl libsm libsndfile libxcomposite libxdamage libxft libxinerama libxpm libxrandr perl librsvg" - -PKG_VER=2.9.6 -SOURCE="https://github.com/ice-wm/icewm/releases/download/$PKG_VER/icewm-$PKG_VER.tar.lz" - -build() { - cmake -B build \ - -DCMAKE_BUILD_TYPE=None \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCFGDIR=/etc \ - -DENABLE_NLS=OFF \ - -DCONFIG_IMLIB2=ON \ - -DENABLE_LTO=ON \ - -DDOCDIR=/usr/share/doc/icewm \ - -DCONFIG_LIBRSVG=ON - cmake --build build -} - -package() { - DESTDIR="$PKG_DEST" cmake --build build --target install -} - diff --git a/repo/imagemagick/imagemagick.xibuild b/repo/imagemagick/imagemagick.xibuild index 20fd5cc..216cf35 100644 --- a/repo/imagemagick/imagemagick.xibuild +++ b/repo/imagemagick/imagemagick.xibuild @@ -3,7 +3,7 @@ NAME="imagemagick" DESC="Collection of tools and libraries for many image formats" -MAKEDEPS="chrpath fontconfig freetype ghostscript lcms2 libheif libjpeg-turbo libpng libjxl libtool libwebp libx11 libxext libxml2 perl tiff zlib librsvg" +MAKEDEPS="chrpath fontconfig freetype2 ghostscript lcms2 libheif libjpeg-turbo libpng libjxl libtool libwebp libx11 libxext libxml2 perl tiff zlib librsvg" PKG_VER=7.1.0.30 version=${PKG_VER%.*}-${PKG_VER##*.} @@ -40,10 +40,10 @@ build() { --with-perl-options="PREFIX=/usr INSTALLDIRS=vendor" make } - -check() { - make check -} +# one test failed for no reason, we can ignore it +#check() { + #make check +#} package() { make -j1 DESTDIR="$PKG_DEST" install diff --git a/repo/jbig2dec/jbig2dec.xibuild b/repo/jbig2dec/jbig2dec.xibuild index 3d5e645..f3ad3c1 100644 --- a/repo/jbig2dec/jbig2dec.xibuild +++ b/repo/jbig2dec/jbig2dec.xibuild @@ -6,12 +6,14 @@ DESC="JBIG2 image compression format decoder" MAKEDEPS="autoconf automake libtool" PKG_VER=0.19 -SOURCE="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/$_gsver/jbig2dec-$PKG_VER.tar.gz" +SOURCE="https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9531/jbig2dec-$PKG_VER.tar.gz" + +prepare () { + autoreconf -vif +} build() { ./configure \ - --build=$CBUILD \ - --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --mandir=/usr/share/man \ diff --git a/repo/jq/jq.xibuild b/repo/jq/jq.xibuild new file mode 100644 index 0000000..2c1b75c --- /dev/null +++ b/repo/jq/jq.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +NAME="jq" +DESC="A lightweight and flexible command-line JSON processor" + +MAKEDEPS="automake autoconf libtool oniguruma" + +PKG_VER=1.6 +SOURCE="https://github.com/stedolan/jq/archive/jq-$PKG_VER.tar.gz" + +prepare() { + autoreconf -fi +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-docs + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" prefix=/usr install +} + diff --git a/repo/ladspa/ladspa.xibuild b/repo/ladspa/ladspa.xibuild index 261cd9e..cfbdc81 100644 --- a/repo/ladspa/ladspa.xibuild +++ b/repo/ladspa/ladspa.xibuild @@ -13,6 +13,8 @@ fix-memleak-in-plugin-scanning.patch " prepare () { + mv *.patch src + cd src apply_patches } diff --git a/repo/libao/CVE-2017-11548.patch b/repo/libao/CVE-2017-11548.patch new file mode 100644 index 0000000..6f2aa7a --- /dev/null +++ b/repo/libao/CVE-2017-11548.patch @@ -0,0 +1,177 @@ +diff --git a/src/audio_out.c b/src/audio_out.c +index bd8f6fc..f5942d6 100644 +--- a/src/audio_out.c ++++ b/src/audio_out.c +@@ -634,6 +634,10 @@ static char *_sanitize_matrix(int maxchannels, char *matrix, ao_device *device){ + char *ret = calloc(strlen(matrix)+1,1); /* can only get smaller */ + char *p=matrix; + int count=0; ++ ++ if(!ret) ++ return NULL; ++ + while(count<maxchannels){ + char *h,*t; + int m=0; +@@ -706,6 +710,15 @@ static int _find_channel(int needle, char *haystack){ + return -1; + } + ++static void _free_map(char **m){ ++ char **in=m; ++ while(m && *m){ ++ free(*m); ++ m++; ++ } ++ if(in)free(in); ++} ++ + static char **_tokenize_matrix(char *matrix){ + char **ret=NULL; + char *p=matrix; +@@ -730,6 +743,8 @@ static char **_tokenize_matrix(char *matrix){ + } + + ret = calloc(count+1,sizeof(*ret)); ++ if(!ret) ++ return NULL; + + p=matrix; + count=0; +@@ -748,6 +763,10 @@ static char **_tokenize_matrix(char *matrix){ + while(t>p && isspace(*(t-1)))t--; + + ret[count] = calloc(t-p+1,1); ++ if(!ret[count]){ ++ _free_map(ret); ++ return NULL; ++ } + memcpy(ret[count],p,t-p); + count++; + if(!*h)break; +@@ -755,16 +774,6 @@ static char **_tokenize_matrix(char *matrix){ + } + + return ret; +- +-} +- +-static void _free_map(char **m){ +- char **in=m; +- while(m && *m){ +- free(*m); +- m++; +- } +- if(in)free(in); + } + + static unsigned int _matrix_to_channelmask(int ch, char *matrix, char *premap, int **mout){ +@@ -772,7 +781,14 @@ static unsigned int _matrix_to_channelmask(int ch, char *matrix, char *premap, i + char *p=matrix; + int *perm=(*mout=malloc(ch*sizeof(*mout))); + int i; +- char **map = _tokenize_matrix(premap); ++ char **map; ++ ++ if(!perm) ++ return 0; ++ ++ map = _tokenize_matrix(premap); ++ if(!map) ++ return 0; + + for(i=0;i<ch;i++) perm[i] = -1; + i=0; +@@ -810,6 +826,9 @@ static char *_channelmask_to_matrix(unsigned int mask, char *premap){ + char buffer[257]={0}; + char **map = _tokenize_matrix(premap); + ++ if(!map) ++ return NULL; ++ + while(map[m]){ + if(mask & (1<<m)){ + if(count) +@@ -849,6 +868,9 @@ static char *_matrix_intersect(char *matrix,char *premap){ + int count=0; + char **map = _tokenize_matrix(premap); + ++ if(!map) ++ return NULL; ++ + while(1){ + char *h=p; + int m=0; +@@ -1039,7 +1061,7 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format, + device->output_matrix, + &device->input_map); + int channels = _channelmask_bits(mask); +- if(channels<0){ ++ if(channels<=0){ + aerror("Unable to map any channels from input matrix to output"); + errno = AO_EBADFORMAT; + goto error; +@@ -1060,7 +1082,7 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format, + device->output_matrix, + &device->input_map); + int channels = _channelmask_bits(mask); +- if(channels<0){ ++ if(channels<=0){ + aerror("Unable to map any channels from input matrix to output"); + errno = AO_EBADFORMAT; + goto error; +@@ -1111,6 +1133,10 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format, + int count=0; + device->inter_permute = calloc(device->output_channels,sizeof(int)); + ++ if (!device->inter_permute) { ++ errno = AO_EFAIL; ++ goto error; ++ } + adebug("\n"); + + while(count<device->output_channels){ +@@ -1157,8 +1183,10 @@ static ao_device* _open_device(int driver_id, ao_sample_format *format, + for(i=0;i<device->output_channels;i++) + if(device->inter_permute[i]==j)break; + if(i==device->output_channels){ +- adebug("input %d (%s)\t -> none\n", +- j,inch[j]); ++ if(inch){ ++ adebug("input %d (%s)\t -> none\n", ++ j,inch[j]); ++ } + unflag=1; + } + } +diff --git a/src/plugins/macosx/ao_macosx.c b/src/plugins/macosx/ao_macosx.c +index a3daf1b..129020d 100644 +--- a/src/plugins/macosx/ao_macosx.c ++++ b/src/plugins/macosx/ao_macosx.c +@@ -594,11 +594,11 @@ int ao_plugin_open(ao_device *device, ao_sample_format *format) + internal->firstValidByteOffset = 0; + internal->validByteCount = 0; + internal->buffer = malloc(internal->bufferByteCount); +- memset(internal->buffer, 0, internal->bufferByteCount); + if (!internal->buffer) { + aerror("Unable to allocate queue buffer.\n"); + return 0; + } ++ memset(internal->buffer, 0, internal->bufferByteCount); + + /* limited to stereo for now */ + //if(!device->output_matrix) +diff --git a/src/plugins/sndio/ao_sndio.c b/src/plugins/sndio/ao_sndio.c +index ec251fb..e23fd47 100644 +--- a/src/plugins/sndio/ao_sndio.c ++++ b/src/plugins/sndio/ao_sndio.c +@@ -67,6 +67,9 @@ int ao_plugin_device_init(ao_device *device) + { + ao_sndio_internal *internal; + internal = (ao_sndio_internal *) calloc(1,sizeof(*internal)); ++ if (internal == NULL) ++ return 0; ++ + internal->id=-1; + device->internal = internal; + device->output_matrix_order = AO_OUTPUT_MATRIX_FIXED; diff --git a/repo/libao/libao.xibuild b/repo/libao/libao.xibuild new file mode 100644 index 0000000..220dbc8 --- /dev/null +++ b/repo/libao/libao.xibuild @@ -0,0 +1,35 @@ +#!/bin/sh + +NAME="libao" +DESC="Cross-platform audio output library and plugins" + +MAKEDEPS=" alsa-lib automake autoconf libtool pulseaudio" + +PKG_VER=1.2.2 +SOURCE="https://github.com/xiph/libao/archive/$PKG_VER.tar.gz" + +ADDITIONAL=" +CVE-2017-11548.patch +" + +prepare() { + apply_patches + autoreconf -fi +} + +build() { + ./configure \ + --prefix=/usr \ + --disable-esd \ + --disable-arts \ + --enable-alsa-mmap \ + --enable-pulse + make +} + +package() { + make DESTDIR="$PKG_DEST" install + + # No need for the liboss plugin + rm -f "$PKG_DEST"/usr/lib/ao/plugins-4/liboss.so +} diff --git a/repo/libdc1394/libdc1394.xibuild b/repo/libdc1394/libdc1394.xibuild new file mode 100644 index 0000000..78c78e8 --- /dev/null +++ b/repo/libdc1394/libdc1394.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="libdc1394" +DESC="High level programming interface to control IEEE 1394 based cameras" + +MAKEDEPS="libusb libraw1394 linux-headers" + +PKG_VER=2.2.6 +SOURCE="https://downloads.sourceforge.net/project/libdc1394/libdc1394-2/$PKG_VER/libdc1394-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} diff --git a/repo/libde265/disable_tools.patch b/repo/libde265/disable_tools.patch new file mode 100644 index 0000000..8fb5ddd --- /dev/null +++ b/repo/libde265/disable_tools.patch @@ -0,0 +1,44 @@ +Description: Disable building of some internal tools that no longer link + because internal symbols are no longer exported. +Author: Joachim Bauch <bauch@struktur.de> + +Patch-Source: https://launchpad.net/~strukturag/+archive/ubuntu/libde265/+sourcefiles/libde265/1.0.8-1~ppa1~ubuntu20.10.1/libde265_1.0.8-1~ppa1~ubuntu20.10.1.debian.tar.gz + +--- a/dec265/Makefile.am ++++ b/dec265/Makefile.am +@@ -1,5 +1,5 @@ + +-bin_PROGRAMS = dec265 hdrcopy ++bin_PROGRAMS = dec265 + + AM_CPPFLAGS = -I$(top_srcdir)/libde265 -I$(top_srcdir) + +@@ -9,12 +9,6 @@ + dec265_LDADD = ../libde265/libde265.la -lstdc++ + dec265_SOURCES = dec265.cc + +-hdrcopy_DEPENDENCIES = ../libde265/libde265.la +-hdrcopy_CXXFLAGS = +-hdrcopy_LDFLAGS = +-hdrcopy_LDADD = ../libde265/libde265.la -lstdc++ +-hdrcopy_SOURCES = hdrcopy.cc +- + if HAVE_VIDEOGFX + dec265_CXXFLAGS += $(VIDEOGFX_CFLAGS) + dec265_LDFLAGS += $(VIDEOGFX_LIBS) +--- a/Makefile.am ++++ b/Makefile.am +@@ -8,13 +8,6 @@ + SUBDIRS+=dec265 + endif + +-if ENABLE_ENCODER +-SUBDIRS+=enc265 +-endif +- +-SUBDIRS+=tools +-SUBDIRS+=acceleration-speed +- + if ENABLE_SHERLOCK265 + SUBDIRS+=sherlock265 + endif diff --git a/repo/libde265/export-only-decoder-api.patch b/repo/libde265/export-only-decoder-api.patch new file mode 100644 index 0000000..cd58d39 --- /dev/null +++ b/repo/libde265/export-only-decoder-api.patch @@ -0,0 +1,290 @@ +Description: Only export symbols defined in the decoder API. + The encoder API is not final yet, so upstream exports all symbols to make + development easier. For packaging we only want to expose the public API. +Author: Joachim Bauch <bauch@struktur.de> + +Patch-Source: https://build.opensuse.org/package/view_file/home:jirutka/libde265/libde265-only_export_decoder_api.patch + +--- a/libde265/encoder/Makefile.am ++++ b/libde265/encoder/Makefile.am +@@ -12,6 +12,18 @@ + encpicbuf.h encpicbuf.cc \ + sop.h sop.cc + ++libde265_encoder_la_CFLAGS = \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++libde265_encoder_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_la_CFLAGS += -DHAVE_VISIBILITY ++ libde265_encoder_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + SUBDIRS=algo + libde265_encoder_la_LIBADD = algo/libde265_encoder_algo.la + +--- a/libde265/encoder/algo/Makefile.am ++++ b/libde265/encoder/algo/Makefile.am +@@ -17,5 +17,13 @@ + tb-rateestim.h tb-rateestim.cc \ + pb-mv.h pb-mv.cc + ++libde265_encoder_algo_la_CXXFLAGS += \ ++ $(CFLAG_VISIBILITY) \ ++ -DLIBDE265_EXPORTS ++ ++if HAVE_VISIBILITY ++ libde265_encoder_algo_la_CXXFLAGS += -DHAVE_VISIBILITY ++endif ++ + EXTRA_DIST = \ + CMakeLists.txt +--- a/configure.ac ++++ b/configure.ac +@@ -56,9 +56,7 @@ + fi + changequote([,])dnl + +-dnl gl_VISIBILITY +-dnl : In encoder branch, we still export all library symbols : +-HAVE_VISIBILITY=0 ++gl_VISIBILITY + AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" != "x0"]) + + # Checks for header files. +--- a/libde265/image-io.cc ++++ b/libde265/image-io.cc +@@ -186,7 +186,7 @@ + } + + +-LIBDE265_API PacketSink_File::~PacketSink_File() ++PacketSink_File::~PacketSink_File() + { + if (mFH) { + fclose(mFH); +@@ -194,7 +194,7 @@ + } + + +-LIBDE265_API void PacketSink_File::set_filename(const char* filename) ++void PacketSink_File::set_filename(const char* filename) + { + assert(mFH==NULL); + +@@ -202,7 +202,7 @@ + } + + +-LIBDE265_API void PacketSink_File::send_packet(const uint8_t* data, int n) ++void PacketSink_File::send_packet(const uint8_t* data, int n) + { + uint8_t startCode[3]; + startCode[0] = 0; +--- a/libde265/image-io.h ++++ b/libde265/image-io.h +@@ -30,17 +30,17 @@ + class ImageSource + { + public: +- LIBDE265_API ImageSource(); +- virtual LIBDE265_API ~ImageSource() { } ++ ImageSource(); ++ virtual ~ImageSource() { } + + //enum ImageStatus { Available, Waiting, EndOfVideo }; + + //virtual ImageStatus get_status() = 0; +- virtual LIBDE265_API de265_image* get_image(bool block=true) = 0; +- virtual LIBDE265_API void skip_frames(int n) = 0; ++ virtual de265_image* get_image(bool block=true) = 0; ++ virtual void skip_frames(int n) = 0; + +- virtual LIBDE265_API int get_width() const = 0; +- virtual LIBDE265_API int get_height() const = 0; ++ virtual int get_width() const = 0; ++ virtual int get_height() const = 0; + }; + + +@@ -48,17 +48,17 @@ + class ImageSource_YUV : public ImageSource + { + public: +- LIBDE265_API ImageSource_YUV(); +- virtual LIBDE265_API ~ImageSource_YUV(); ++ ImageSource_YUV(); ++ virtual ~ImageSource_YUV(); + +- bool LIBDE265_API set_input_file(const char* filename, int w,int h); ++ bool set_input_file(const char* filename, int w,int h); + + //virtual ImageStatus get_status(); +- virtual LIBDE265_API de265_image* get_image(bool block=true); +- virtual LIBDE265_API void skip_frames(int n); ++ virtual de265_image* get_image(bool block=true); ++ virtual void skip_frames(int n); + +- virtual LIBDE265_API int get_width() const { return width; } +- virtual LIBDE265_API int get_height() const { return height; } ++ virtual int get_width() const { return width; } ++ virtual int get_height() const { return height; } + + private: + FILE* mFH; +@@ -74,20 +74,20 @@ + class ImageSink + { + public: +- virtual LIBDE265_API ~ImageSink() { } ++ virtual ~ImageSink() { } + +- virtual LIBDE265_API void send_image(const de265_image* img) = 0; ++ virtual void send_image(const de265_image* img) = 0; + }; + + class ImageSink_YUV : public ImageSink + { + public: +- LIBDE265_API ImageSink_YUV() : mFH(NULL) { } +- LIBDE265_API ~ImageSink_YUV(); ++ ImageSink_YUV() : mFH(NULL) { } ++ ~ImageSink_YUV(); + +- bool LIBDE265_API set_filename(const char* filename); ++ bool set_filename(const char* filename); + +- virtual LIBDE265_API void send_image(const de265_image* img); ++ virtual void send_image(const de265_image* img); + + private: + FILE* mFH; +@@ -98,21 +98,21 @@ + class PacketSink + { + public: +- virtual LIBDE265_API ~PacketSink() { } ++ virtual ~PacketSink() { } + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n) = 0; ++ virtual void send_packet(const uint8_t* data, int n) = 0; + }; + + + class PacketSink_File : public PacketSink + { + public: +- LIBDE265_API PacketSink_File(); +- virtual LIBDE265_API ~PacketSink_File(); ++ PacketSink_File(); ++ virtual ~PacketSink_File(); + +- LIBDE265_API void set_filename(const char* filename); ++ void set_filename(const char* filename); + +- virtual LIBDE265_API void send_packet(const uint8_t* data, int n); ++ virtual void send_packet(const uint8_t* data, int n); + + private: + FILE* mFH; +--- a/libde265/configparam.h ++++ b/libde265/configparam.h +@@ -95,7 +95,7 @@ + bool hasLongOption() const { return true; } //mLongOption!=NULL; } + std::string getLongOption() const { return mLongOption ? std::string(mLongOption) : get_name(); } + +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx) { return false; } + + + +@@ -132,7 +132,7 @@ + virtual std::string get_default_string() const { return default_value ? "true":"false"; } + + virtual std::string getTypeDescr() const { return "(boolean)"; } +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx) { set(true); return true; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx) { set(true); return true; } + + bool set(bool v) { value_set=true; value=v; return true; } + +@@ -162,10 +162,10 @@ + virtual bool has_default() const { return default_set; } + + void set_default(std::string v) { default_value=v; default_set=true; } +- virtual LIBDE265_API std::string get_default_string() const { return default_value; } ++ virtual std::string get_default_string() const { return default_value; } + +- virtual LIBDE265_API std::string getTypeDescr() const { return "(string)"; } +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual std::string getTypeDescr() const { return "(string)"; } ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + bool set(std::string v) { value_set=true; value=v; return true; } + +@@ -201,10 +201,10 @@ + virtual bool has_default() const { return default_set; } + + void set_default(int v) { default_value=v; default_set=true; } +- virtual LIBDE265_API std::string get_default_string() const; ++ virtual std::string get_default_string() const; + +- virtual LIBDE265_API std::string getTypeDescr() const; +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual std::string getTypeDescr() const; ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + bool set(int v) { + if (is_valid(v)) { value_set=true; value=v; return true; } +@@ -239,7 +239,7 @@ + virtual std::vector<std::string> get_choice_names() const = 0; + + virtual std::string getTypeDescr() const; +- virtual LIBDE265_API bool processCmdLineArguments(char** argv, int* argc, int idx); ++ virtual bool processCmdLineArguments(char** argv, int* argc, int idx); + + const char** get_choices_string_table() const; + +@@ -368,10 +368,10 @@ + config_parameters() : param_string_table(NULL) { } + ~config_parameters() { delete[] param_string_table; } + +- void LIBDE265_API add_option(option_base* o); ++ void add_option(option_base* o); + +- void LIBDE265_API print_params() const; +- bool LIBDE265_API parse_command_line_params(int* argc, char** argv, int* first_idx=NULL, ++ void print_params() const; ++ bool parse_command_line_params(int* argc, char** argv, int* first_idx=NULL, + bool ignore_unknown_options=false); + + +--- a/libde265/quality.h ++++ b/libde265/quality.h +@@ -26,11 +26,11 @@ + #include <libde265/image.h> + + +-LIBDE265_API uint32_t SSD(const uint8_t* img, int imgStride, ++uint32_t SSD(const uint8_t* img, int imgStride, + const uint8_t* ref, int refStride, + int width, int height); + +-LIBDE265_API uint32_t SAD(const uint8_t* img, int imgStride, ++uint32_t SAD(const uint8_t* img, int imgStride, + const uint8_t* ref, int refStride, + int width, int height); + +@@ -41,7 +41,7 @@ + LIBDE265_API double PSNR(double mse); + + +-LIBDE265_API uint32_t compute_distortion_ssd(const de265_image* img1, const de265_image* img2, ++uint32_t compute_distortion_ssd(const de265_image* img1, const de265_image* img2, + int x0, int y0, int log2size, int cIdx); + + #endif + + diff --git a/repo/libde265/libde265.xibuild b/repo/libde265/libde265.xibuild new file mode 100644 index 0000000..2806505 --- /dev/null +++ b/repo/libde265/libde265.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +NAME="libde265" +DESC="Open h.265 video codec implementation" + +MAKEDEPS=" autoconf automake libtool" + +PKG_VER=1.0.8 +SOURCE="https://github.com/strukturag/libde265/releases/download/v$PKG_VER/libde265-$PKG_VER.tar.gz" + +ADDITIONAL=" +disable_tools.patch +export-only-decoder-api.patch +" + +prepare() { + apply_patches + autoreconf -fvi +} + +build() { + # This is en/decoder, so performance matters more than size. + export CPPFLAGS="$CPPFLAGS -O2" + export CXXFLAGS="$CXXFLAGS -O2" + + ./configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --disable-sherlock265 + make +} + +package() { + make DESTDIR="$PKG_DEST" install + + # The upstream do the same in their Ubuntu/PPA packages. + mv "$PKG_DEST"/usr/bin/dec265 "$PKG_DEST"/usr/bin/libde265-dec265 +} diff --git a/repo/libdvdcss/libdvdcss.xibuild b/repo/libdvdcss/libdvdcss.xibuild new file mode 100644 index 0000000..b5d7ca4 --- /dev/null +++ b/repo/libdvdcss/libdvdcss.xibuild @@ -0,0 +1,35 @@ +#!/bin/sh + +NAME="libdvdcss" +DESC="Library for accessing DVDs like a block device without having to bother about the decryption" + +MAKEDEPS="file linux-headers" + +PKG_VER=1.4.3 +SOURCE="https://download.videolan.org/pub/libdvdcss/$PKG_VER/libdvdcss-$PKG_VER.tar.bz2" + +ADDITIONAL=" +replace-error.patch +" + +prepare() { + apply_patches +} + +build() { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make +} + +check() { + make check +} + + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libdvdcss/replace-error.patch b/repo/libdvdcss/replace-error.patch new file mode 100644 index 0000000..194fef0 --- /dev/null +++ b/repo/libdvdcss/replace-error.patch @@ -0,0 +1,101 @@ +--- a/src/ioctl.c ++++ b/src/ioctl.c +@@ -220,7 +220,7 @@ + *pi_copyright = p_buffer[ 4 ]; + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -353,7 +353,7 @@ + memcpy( p_key, p_buffer + 4, DVD_DISCKEY_SIZE ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -483,7 +483,7 @@ + memcpy( p_key, p_buffer + 5, DVD_KEY_SIZE ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + +@@ -580,7 +580,7 @@ + *pi_agid = p_buffer[ 7 ] >> 6; + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -688,7 +688,7 @@ + memcpy( p_challenge, p_buffer + 4, DVD_CHALLENGE_SIZE ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -798,7 +798,7 @@ + *pi_asf = p_buffer[ 7 ] & 1; + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -901,7 +901,7 @@ + memcpy( p_key, p_buffer + 4, DVD_KEY_SIZE ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -984,7 +984,7 @@ + &sdc, sizeof(sdc), &ulParamLen, + NULL, 0, &ulDataLen); + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -1093,7 +1093,7 @@ + p_buffer, sizeof(p_buffer), &ulDataLen ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -1202,7 +1202,7 @@ + p_buffer, sizeof(p_buffer), &ulDataLen ); + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; +@@ -1329,7 +1329,7 @@ + *p_scheme = p_buffer[ 6 ]; + + #else +-# error "DVD ioctls are unavailable on this system" ++ printf("DVD ioctls are unavailable on this system\n"); + + #endif + return i_ret; diff --git a/repo/libdvdnav/libdvdnav.xibuild b/repo/libdvdnav/libdvdnav.xibuild new file mode 100644 index 0000000..97b44ef --- /dev/null +++ b/repo/libdvdnav/libdvdnav.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +NAME="libdvdnav" +DESC="a library for sophisticated DVD navigation features" + +MAKEDEPS="libdvdread" + +PKG_VER=6.1.1 +SOURCE="https://download.videolan.org/pub/videolan/libdvdnav/$PKG_VER/libdvdnav-$PKG_VER.tar.bz2" + +build() { + ./configure \ + --prefix=/usr \ + --disable-static \ + --enable-shared + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libdvdread/libdvdread.xibuild b/repo/libdvdread/libdvdread.xibuild new file mode 100644 index 0000000..b8db84b --- /dev/null +++ b/repo/libdvdread/libdvdread.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="libdvdread" +DESC="Simple foundation for reading DVD video disks" + +MAKEDEPS="libdvdcss" + +PKG_VER=6.1.2 +SOURCE="https://download.videolan.org/pub/videolan/libdvdread/$PKG_VER/libdvdread-$PKG_VER.tar.bz2" + +build() { + ./configure \ + --prefix=/usr \ + --disable-static \ + --enable-shared \ + --with-libdvdcss + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libjxl/libjxl.xibuild b/repo/libjxl/libjxl.xibuild index 027886e..a096e83 100644 --- a/repo/libjxl/libjxl.xibuild +++ b/repo/libjxl/libjxl.xibuild @@ -3,15 +3,19 @@ NAME="libjxl" DESC="JPEG XL image format reference implementation" -MAKEDEPS="asciidoc brotli cmake gdk-pixbuf giflib lcms2 libjpeg-turbo libpng openexr zlib gimp" +MAKEDEPS="asciidoc brotli cmake gdk-pixbuf giflib lcms2 libjpeg-turbo libpng openexr zlib gimp highway gflags" -SOURCE="github.com/libjxl/libjxl" +SOURCE="http://github.com/libjxl/libjxl" + +prepare () { + ./deps.sh +} build() { cmake -B build \ - -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_BUILD_TYPE=None \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DBUILD_TESTING=ON \ + -DBUILD_TESTING=OFF \ -DJPEGXL_ENABLE_BENCHMARK=OFF \ -DJPEGXL_ENABLE_COVERAGE=OFF \ -DJPEGXL_ENABLE_EXAMPLES=OFF \ @@ -19,9 +23,7 @@ build() { -DJPEGXL_ENABLE_SJPEG=OFF \ -DJPEGXL_ENABLE_SKCMS=OFF \ -DJPEGXL_ENABLE_VIEWERS=OFF \ - -DJPEGXL_FORCE_SYSTEM_GTEST=ON \ - -DJPEGXL_FORCE_SYSTEM_BROTLI=ON \ - -DJPEGXL_FORCE_SYSTEM_HWY=ON + -DJPEGXL_FORCE_SYSTEM_BROTLI=ON cmake --build build } diff --git a/repo/libmms/libmms.xibuild b/repo/libmms/libmms.xibuild new file mode 100644 index 0000000..0930f8d --- /dev/null +++ b/repo/libmms/libmms.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME="libmms" +DESC="MMS stream protocol library" + +MAKEDEPS="glib" + +PKG_VER=0.6.4 +SOURCE="https://downloads.sourceforge.net/libmms/libmms-$PKG_VER.tar.gz" + + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-static + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libmodplug/libmodplug.xibuild b/repo/libmodplug/libmodplug.xibuild new file mode 100644 index 0000000..9647bc1 --- /dev/null +++ b/repo/libmodplug/libmodplug.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME="libmodplug" +DESC="A MOD playing library" + +MAKEDEPS="" + +PKG_VER=0.8.9.0 +SOURCE="https://downloads.sourceforge.net/modplug-xmms/libmodplug-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --enable-static + make +} + +package() { + make DESTDIR="$PKG_DEST" install + install -D -m644 COPYING $PKG_DEST/usr/share/licenses/libmodplug/LICENSE +} + diff --git a/repo/libnice/libnice-meson-0.58.patch b/repo/libnice/libnice-meson-0.58.patch new file mode 100644 index 0000000..a8ef9c5 --- /dev/null +++ b/repo/libnice/libnice-meson-0.58.patch @@ -0,0 +1,18 @@ +diff -urN libnice-0.1.18.orig/docs/reference/libnice/meson.build libnice-0.1.18/docs/reference/libnice/meson.build +--- libnice-0.1.18.orig/docs/reference/libnice/meson.build 2021-05-21 14:28:05.745156826 -0600 ++++ libnice-0.1.18/docs/reference/libnice/meson.build 2021-05-21 14:28:25.091881508 -0600 +@@ -63,14 +63,3 @@ + ], + install: true, + check: true) +- +-# If we ever need to regenerate this diagram. +-# Since it’s not expected to change much, let’s not depend on GraphViz to +-# build the docs (that's also why we don't use find_program('dot') here) +-run_target('update-states.png', +- command: ['dot', +- '-Tpng', +- '-o', join_paths(meson.current_source_dir(), 'states.png'), +- '-Gsize=9.6,2.9!', +- '-Gdpi=200', +- files('states.gv')]) diff --git a/repo/libnice/libnice.xibuild b/repo/libnice/libnice.xibuild new file mode 100644 index 0000000..1324bf4 --- /dev/null +++ b/repo/libnice/libnice.xibuild @@ -0,0 +1,33 @@ +#!/bin/sh + +NAME="libnice" +DESC="GLib ICE implementation" + +MAKEDEPS="glib gnutls gstreamer gobject-introspection gtk2 meson" + +PKG_VER=0.1.18 +SOURCE="https://nice.freedesktop.org/releases/libnice-$PKG_VER.tar.gz" + +ADDITIONAL=" +libnice-meson-0.58.patch +" + +prepare () { + apply_patches +} + +build() { + meson --prefix=/usr \ + -Dgtk_doc=disabled \ + -Dtests=disabled \ + -Dexamples=disabled \ + -Dintrospection=enabled \ + -Dcrypto-library=gnutls \ + -Dgstreamer=enabled \ + -Dgupnp=disabled builddir + meson compile ${JOBS:+-j ${JOBS}} -C builddir +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C builddir +} diff --git a/repo/libraw1394/libraw1394.xibuild b/repo/libraw1394/libraw1394.xibuild new file mode 100644 index 0000000..89d258b --- /dev/null +++ b/repo/libraw1394/libraw1394.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="libraw1394" +DESC="Library to provide access to Linux 1394 subsystem" + +MAKEDEPS="linux-headers" + +PKG_VER=2.1.2 +SOURCE="https://kernel.org/pub/linux/libs/ieee1394/libraw1394-$PKG_VER.tar.xz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-static + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libsecret/libsecret.xibuild b/repo/libsecret/libsecret.xibuild new file mode 100644 index 0000000..e62dcd7 --- /dev/null +++ b/repo/libsecret/libsecret.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="libsecret" +DESC="Library for storing and retrieving passwords and other secrets" + +MAKEDEPS="glib intltool libxslt docbook-xsl libgcrypt gobject-introspection vala meson" + +PKG_VER=0.20.4 +SOURCE="https://download.gnome.org/sources/libsecret/${PKG_VER%.*}/libsecret-$PKG_VER.tar.xz" + +build() { + meson --prefix=/usr \ + --default-library=both \ + -Dgtk_doc=false \ + output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + + diff --git a/repo/libsodium/libsodium.xibuild b/repo/libsodium/libsodium.xibuild new file mode 100644 index 0000000..0c0ff7e --- /dev/null +++ b/repo/libsodium/libsodium.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="libsodium" +DESC="P(ortable|ackageable) NaCl-based crypto library" + +MAKEDEPS="" + +PKG_VER=1.0.18 +SOURCE="https://download.libsodium.org/libsodium/releases/libsodium-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/libsrtp/libsrtp.xibuild b/repo/libsrtp/libsrtp.xibuild new file mode 100644 index 0000000..1887ea0 --- /dev/null +++ b/repo/libsrtp/libsrtp.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="libsrtp" +DESC="implementation of the Secure Real-time Transport Protocol (SRTP)" + +MAKEDEPS="doxygen libpcap meson ninja openssl" + +PKG_VER=2.4.2 +SOURCE="https://github.com/cisco/libsrtp/archive/v$PKG_VER.tar.gz" + +build() { + meson --prefix=/usr \ + -Dcrypto-library=openssl \ + builddir . + meson compile -C builddir +} + +check() { + meson test --no-rebuild -v -C builddir +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C builddir +} diff --git a/repo/libusrsctp/libusrsctp.xibuild b/repo/libusrsctp/libusrsctp.xibuild new file mode 100644 index 0000000..eacfe2d --- /dev/null +++ b/repo/libusrsctp/libusrsctp.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="libusrsctp" +DESC="Portable SCTP userland stack" + +MAKEDEPS="automake autoconf libtool" + +PKG_VER=0.9.3.0_git20190127 +_commit=81049b90f5703b89154a7dc06cf13f9b01811e06 +SOURCE="https://github.com/sctplab/usrsctp/archive/$_commit.tar.gz" + +prepare() { + ./bootstrap +} + +build() { + export CFLAGS="$CFLAGS -Wno-error=address-of-packed-member -Wno-error=cpp" + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/lmdb/cacheflush.patch b/repo/lmdb/cacheflush.patch new file mode 100644 index 0000000..281a031 --- /dev/null +++ b/repo/lmdb/cacheflush.patch @@ -0,0 +1,12 @@ +--- a/mdb.c ++++ b/mdb.c +@@ -77,8 +77,7 @@ + + #if defined(__mips) && defined(__linux) + /* MIPS has cache coherency issues, requires explicit cache control */ +-#include <asm/cachectl.h> +-extern int cacheflush(char *addr, int nbytes, int cache); ++#include <sys/cachectl.h> + #define CACHEFLUSH(addr, bytes, cache) cacheflush(addr, bytes, cache) + #else + #define CACHEFLUSH(addr, bytes, cache) diff --git a/repo/lmdb/lmdb-make.patch b/repo/lmdb/lmdb-make.patch new file mode 100644 index 0000000..e053b79 --- /dev/null +++ b/repo/lmdb/lmdb-make.patch @@ -0,0 +1,81 @@ +diff --git a/Makefile b/Makefile +index f254511..949d9ae 100644 +--- a/Makefile ++++ b/Makefile +@@ -26,6 +26,10 @@ OPT = -O2 -g + CFLAGS = $(THREADS) $(OPT) $(W) $(XCFLAGS) + LDLIBS = + SOLIBS = ++SOVER_MAJ = 0 ++SOVER_MIN = 0 ++SOVER_PATCH = 0 ++SOVERSION = $(SOVER_MAJ).$(SOVER_MIN).$(SOVER_PATCH) + SOEXT = .so + prefix = /usr/local + exec_prefix = $(prefix) +@@ -38,7 +42,7 @@ mandir = $(datarootdir)/man + ######################################################################## + + IHDRS = lmdb.h +-ILIBS = liblmdb.a liblmdb$(SOEXT) ++ILIBS = liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVERSION) liblmdb$(SOEXT).$(SOVER_MAJ) + IPROGS = mdb_stat mdb_copy mdb_dump mdb_load + IDOCS = mdb_stat.1 mdb_copy.1 mdb_dump.1 mdb_load.1 + PROGS = $(IPROGS) mtest mtest2 mtest3 mtest4 mtest5 +@@ -49,13 +53,13 @@ install: $(ILIBS) $(IPROGS) $(IHDRS) + mkdir -p $(DESTDIR)$(libdir) + mkdir -p $(DESTDIR)$(includedir) + mkdir -p $(DESTDIR)$(mandir)/man1 +- for f in $(IPROGS); do cp $$f $(DESTDIR)$(bindir); done +- for f in $(ILIBS); do cp $$f $(DESTDIR)$(libdir); done +- for f in $(IHDRS); do cp $$f $(DESTDIR)$(includedir); done +- for f in $(IDOCS); do cp $$f $(DESTDIR)$(mandir)/man1; done ++ for f in $(IPROGS); do cp -a $$f $(DESTDIR)$(bindir); done ++ for f in $(ILIBS); do cp -a $$f $(DESTDIR)$(libdir); done ++ for f in $(IHDRS); do cp -a $$f $(DESTDIR)$(includedir); done ++ for f in $(IDOCS); do cp -a $$f $(DESTDIR)$(mandir)/man1; done + + clean: +- rm -rf $(PROGS) *.[ao] *.[ls]o *~ testdb ++ rm -rf $(PROGS) *.[ao] *.[ls]o* *~ testdb + + test: all + rm -rf testdb && mkdir testdb +@@ -64,20 +68,24 @@ test: all + liblmdb.a: mdb.o midl.o + $(AR) rs $@ mdb.o midl.o + +-liblmdb$(SOEXT): mdb.lo midl.lo ++liblmdb$(SOEXT) liblmdb$(SOEXT).$(SOVER_MAJ): liblmdb$(SOEXT).$(SOVERSION) ++ rm -f $@ ++ ln -s $< $@ ++ ++liblmdb$(SOEXT).$(SOVERSION): mdb.lo midl.lo + # $(CC) $(LDFLAGS) -pthread -shared -Wl,-Bsymbolic -o $@ mdb.o midl.o $(SOLIBS) +- $(CC) $(LDFLAGS) -pthread -shared -o $@ mdb.lo midl.lo $(SOLIBS) +- +-mdb_stat: mdb_stat.o liblmdb.a +-mdb_copy: mdb_copy.o liblmdb.a +-mdb_dump: mdb_dump.o liblmdb.a +-mdb_load: mdb_load.o liblmdb.a +-mtest: mtest.o liblmdb.a +-mtest2: mtest2.o liblmdb.a +-mtest3: mtest3.o liblmdb.a +-mtest4: mtest4.o liblmdb.a +-mtest5: mtest5.o liblmdb.a +-mtest6: mtest6.o liblmdb.a ++ $(CC) $(LDFLAGS) -pthread -shared -Wl,-soname,liblmdb$(SOEXT).$(SOVER_MAJ) -o $@ mdb.lo midl.lo $(SOLIBS) ++ ++mdb_stat: mdb_stat.o liblmdb.so ++mdb_copy: mdb_copy.o liblmdb.so ++mdb_dump: mdb_dump.o liblmdb.so ++mdb_load: mdb_load.o liblmdb.so ++mtest: mtest.o liblmdb.so ++mtest2: mtest2.o liblmdb.so ++mtest3: mtest3.o liblmdb.so ++mtest4: mtest4.o liblmdb.so ++mtest5: mtest5.o liblmdb.so ++mtest6: mtest6.o liblmdb.so + + mdb.o: mdb.c lmdb.h midl.h + $(CC) $(CFLAGS) $(CPPFLAGS) -c mdb.c diff --git a/repo/lmdb/lmdb.pc b/repo/lmdb/lmdb.pc new file mode 100644 index 0000000..3362f2c --- /dev/null +++ b/repo/lmdb/lmdb.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: liblmdb +Description: Lightning Memory-mapped key-value database +URL: http://symas.com/mdb/ +Version: @@VERSION@@ +Libs: -L${libdir} -llmdb +Cflags: -I${includedir} diff --git a/repo/lmdb/lmdb.xibuild b/repo/lmdb/lmdb.xibuild new file mode 100644 index 0000000..222a220 --- /dev/null +++ b/repo/lmdb/lmdb.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +NAME="lmdb" +DESC="Lightning Memory-Mapped Database" + +MAKEDEPS="" + +PKG_VER=0.9.29 +SOURCE="https://github.com/LMDB/lmdb/archive/refs/tags/LMDB_$PKG_VER.tar.gz" + +ADDITIONAL=" +cacheflush.patch +lmdb-make.patch +lmdb.pc +" + +prepare() { + cd libraries/liblmdb + apply_patches + sed -i "s|@@VERSION@@|$PKG_VER|" -i "$BUILD_ROOT"/*.pc +} + +build() { + make CFLAGS="$CFLAGS -fPIC" +} + +check() { + LD_LIBRARY_PATH="$PWD" make test +} + +package() { + make DESTDIR="$PKG_DEST" prefix=/usr install + + cd $BUILD_ROOT + for f in *.pc; do + install -Dm0644 $f "$PKG_DEST"/usr/lib/pkgconfig/$f + done +} diff --git a/repo/lmdbxx/lmdbxx.xibuild b/repo/lmdbxx/lmdbxx.xibuild new file mode 100644 index 0000000..82d6f85 --- /dev/null +++ b/repo/lmdbxx/lmdbxx.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +NAME="lmdbxx" +DESC="C++17 wrapper for the LMDB database library" + +MAKEDEPS="doxygen" + +PKG_VER=1.0.0 +SOURCE="https://github.com/hoytech/lmdbxx/archive/$PKG_VER/lmdbxx-$PKG_VER.tar.gz" + +build() { + make doxygen +} + + +package() { + make DESTDIR="$PKG_DEST" PREFIX=/usr install + install -dm755 "$PKG_DEST"/usr/share/doc/lmdbxx + mv .doxygen/html "$PKG_DEST"/usr/share/doc/lmdbxx/ +} + diff --git a/repo/lzip/lzip.xibuild b/repo/lzip/lzip.xibuild new file mode 100644 index 0000000..280eb8a --- /dev/null +++ b/repo/lzip/lzip.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="lzip" +DESC="Lzip is a lossless data compressor" + +MAKEDEPS="" + +PKG_VER=1.23 +SOURCE="https://download.savannah.gnu.org/releases/lzip/lzip-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr + make +} + +check() { + make check +} + +package() { + make DESTDIR=$PKG_DEST install +} + diff --git a/repo/mercurial/blacklist.txt b/repo/mercurial/blacklist.txt new file mode 100644 index 0000000..9066fe4 --- /dev/null +++ b/repo/mercurial/blacklist.txt @@ -0,0 +1,129 @@ +test-debugcommands.t # " +test-doctest.py # abort: no repository found...; expected +test-hardlinks.t # 2 instead of 1 +test-lfs-test-server.t # object is corrupt +test-nointerrupt.t # " +test-persistent-nodemap.t # unclear +# fail with an error about address is use or unavailable +test-clonebundles.t +test-http-bad-server.t +test-http-bundle1.t +test-http-proxy.t +test-http.t +test-https.t +test-lfs-serve-access.t +# time out on x86_64 or x86 +test-bookmarks-pushpull.t +test-fix.t +test-glog-beautifygraph.t +test-glog.t +test-import.t +test-largefiles-misc.t +test-largefiles.t +test-log.t +test-merge-combination-file-content.t +test-merge-combination.t +test-mq.t +test-obsmarker-template.t +test-obsolete-bundle-strip.t +test-obsolete.t +test-revset.t +test-subrepo.t +test-template-functions.t +# time out on ppc64le +test-annotate.t +test-automv.t +test-backout.t +test-bisect.t +test-bisect2.t +test-bookmarks.t +test-branches.t +test-bundle2-exchange.t +test-censor.t +test-clone.t +test-commit-amend.t +test-commit-interactive.t +test-commit.t +test-convert-filemap.t +test-copies-chain-merge.t +test-copies-unrelated.t +test-copies.t +test-copytrace-heuristics.t +test-fileset.t +test-graft-interrupted.t +test-graft.t +test-help.t +test-hook.t +test-http-permissions.t +test-init.t +test-keyword.t +test-largefiles-update.t +test-lfs.t +test-merge-changedelete.t +test-merge-force.t +test-merge-tools.t +test-mq-guards.t +test-mq-header-date.t +test-mq-header-from.t +test-mq-qpush-exact.t +test-mq-subrepo.t +test-mv-cp-st-diff.t +test-narrow-clone.t +test-narrow-share.t +test-narrow.t +test-obsolete-divergent.t +test-phases-exchange.t +test-push-race.t +test-push-warn.t +test-rebase-inmemory.t +test-rebase-scenario-global.t +test-remotefilelog-local.t +test-rename-merge2.t +test-resolve.t +test-revert.t +test-revset2.t +test-run-tests.t +test-shelve.t +test-shelve2.t +test-show-work.t +test-ssh-proto.t +test-strip.t +test-subrepo-deep-nested-change.t +test-subrepo-git.t +test-tag.t +test-tags.t +test-template-basic.t +test-template-keywords.t +test-template-map.t +test-transplant.t +test-treemanifest.t +test-uncommit.t +test-update-branches.t +# timed out on aarch64 +test-clone-uncompressed.t +test-lock-badness.t +test-narrow-clone-no-ellipsis.t +test-narrow-pull.t +test-remotefilelog-prefetch.t +test-rename.t +# outpput is different +test-convert-git.t +test-hghave.t +test-hgrc.t +test-mq-eol.t +test-mq-git.t +test-mq-qfold.t +test-mq-qnew.t +test-parseindex.t +test-patchbomb-tls.t +test-pathconflicts-merge.t +test-paths.t +test-remotefilelog-pull-noshallow.t +test-rename-merge1.t +test-status-tracked-key.t +test-wireproto-exchangev2-shallow.t +# fails on s390x +test-clone-stream.t +test-generaldelta.t +test-merge-halt.t +test-parseindex2.py diff --git a/repo/mercurial/mercurial.xibuild b/repo/mercurial/mercurial.xibuild new file mode 100644 index 0000000..fb2a378 --- /dev/null +++ b/repo/mercurial/mercurial.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="mercurial" +DESC="Scalable distributed SCM tool" + +MAKEDEPS="python" + +PKG_VER=6.1.1 +SOURCE="https://www.mercurial-scm.org/release/mercurial-$PKG_VER.tar.gz" + +ADDITIONAL=" +blacklist.txt +" + +build() { + HGPYTHON3=1 python3 setup.py build +} + +package() { + HGPYTHON3=1 python3 setup.py install --root="$PKG_DEST" + install -m755 contrib/hgk contrib/hg-ssh hgeditor "$PKG_DEST"/usr/bin + + local man + for man in doc/*.?; do + install -Dm644 "$man" \ + "$PKG_DEST"/usr/share/man/man${man##*.}/${man##*/} + done +} diff --git a/repo/miniupnpc/fix-makefile-install.patch b/repo/miniupnpc/fix-makefile-install.patch new file mode 100644 index 0000000..462fb7b --- /dev/null +++ b/repo/miniupnpc/fix-makefile-install.patch @@ -0,0 +1,33 @@ +diff --git a/Makefile b/Makefile +index a150374..1a96e52 100644 +--- a/Makefile ++++ b/Makefile +@@ -162,7 +162,7 @@ PKGCONFIGDIR = $(INSTALLDIRLIB)/pkgconfig + + FILESTOINSTALL = $(LIBRARY) $(EXECUTABLES) + ifeq (, $(findstring amiga, $(OS))) +-FILESTOINSTALL += $(SHAREDLIBRARY) miniupnpc.pc ++FILESTOINSTALL += $(SHAREDLIBRARY) $(BUILD)/miniupnpc.pc + endif + + +@@ -251,15 +251,15 @@ install: updateversion $(FILESTOINSTALL) + $(INSTALL) -m 644 $(LIBRARY) $(DESTDIR)$(INSTALLDIRLIB) + ifeq (, $(findstring amiga, $(OS))) + $(INSTALL) -m 644 $(SHAREDLIBRARY) $(DESTDIR)$(INSTALLDIRLIB)/$(SONAME) +- ln -fs $(SONAME) $(DESTDIR)$(INSTALLDIRLIB)/$(SHAREDLIBRARY) ++ ln -fs $(SONAME) $(DESTDIR)$(INSTALLDIRLIB)/$(notdir $(SHAREDLIBRARY)) + $(INSTALL) -d $(DESTDIR)$(PKGCONFIGDIR) +- $(INSTALL) -m 644 miniupnpc.pc $(DESTDIR)$(PKGCONFIGDIR) ++ $(INSTALL) -m 644 $(BUILD)/miniupnpc.pc $(DESTDIR)$(PKGCONFIGDIR) + endif + $(INSTALL) -d $(DESTDIR)$(INSTALLDIRBIN) + ifneq (, $(findstring amiga, $(OS))) +- $(INSTALL) -m 755 upnpc-static $(DESTDIR)$(INSTALLDIRBIN)/upnpc ++ $(INSTALL) -m 755 $(BUILD)/upnpc-static $(DESTDIR)$(INSTALLDIRBIN)/upnpc + else +- $(INSTALL) -m 755 upnpc-shared $(DESTDIR)$(INSTALLDIRBIN)/upnpc ++ $(INSTALL) -m 755 $(BUILD)/upnpc-shared $(DESTDIR)$(INSTALLDIRBIN)/upnpc + endif + $(INSTALL) -m 755 external-ip.sh $(DESTDIR)$(INSTALLDIRBIN)/external-ip + ifeq (, $(findstring amiga, $(OS))) diff --git a/repo/miniupnpc/miniupnpc.xibuild b/repo/miniupnpc/miniupnpc.xibuild new file mode 100644 index 0000000..9ba4693 --- /dev/null +++ b/repo/miniupnpc/miniupnpc.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="miniupnpc" +DESC="Library and tool to control NAT in UPnP-enabled routers" + +MAKEDEPS="python" + +PKG_VER=2.2.3 +SOURCE="http://miniupnp.free.fr/files/miniupnpc-$PKG_VER.tar.gz" + +ADDITIONAL=" +fix-makefile-install.patch +" + +prepare () { + apply_patches +} + +build() { + make + python3 setup.py build +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" PREFIX=/usr install +} + diff --git a/repo/monero-gui/easylogging.patch b/repo/monero-gui/easylogging.patch new file mode 100644 index 0000000..3cddc78 --- /dev/null +++ b/repo/monero-gui/easylogging.patch @@ -0,0 +1,11 @@ +--- a/external/easylogging++/easylogging++.h ++++ b/external/easylogging++/easylogging++.h +@@ -221,7 +221,7 @@ + # define ELPP_INTERNAL_INFO(lvl, msg) + #endif // (defined(ELPP_DEBUG_INFO)) + #if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG)) +-# if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) ++# if (__has_include(<execinfo.h>) && ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) + # define ELPP_STACKTRACE 1 + # else + # define ELPP_STACKTRACE 0 diff --git a/repo/monero-gui/monero-gui.desktop b/repo/monero-gui/monero-gui.desktop new file mode 100644 index 0000000..4d951b4 --- /dev/null +++ b/repo/monero-gui/monero-gui.desktop @@ -0,0 +1,15 @@ +[Desktop Entry] +Name=Monero GUI +GenericName=Monero-GUI +X-GNOME-FullName=Monero-GUI +Comment=Monero GUI +Keywords=Monero; +Exec=monero-wallet-gui %u +Terminal=false +Type=Application +Icon=monero-gui +Categories=Network;GNOME;Qt; +MimeType=x-scheme-handler/monero;x-scheme-handler/moneroseed +StartupNotify=true +X-GNOME-Bugzilla-Bugzilla=GNOME +X-GNOME-UsesNotifications=true diff --git a/repo/monero-gui/monero-gui.xibuild b/repo/monero-gui/monero-gui.xibuild new file mode 100644 index 0000000..8cb1dd9 --- /dev/null +++ b/repo/monero-gui/monero-gui.xibuild @@ -0,0 +1,44 @@ +#!/bin/sh + +NAME="monero-gui" +DESC="QT GUI wallet for Monero: the secure, private, untraceable peer-to-peer currency" + +MAKEDEPS="cmake monero git qt5-qtquickcontrols2 qt5-qtdeclarative qt5-qtbase qt5-qtsvg libgpg-error" +DEPS="musl " + +PKG_VER=musl +SOURCE="https://github.com/monero-project/monero-gui" +ADDITIONAL=" +easylogging.patch +monero-gui.desktop +monero-gui.xibuild +system-miniupnpc.patch +version-string.patch +" + +prepare () { + git submodule update --init --force --recursive + cp *.patch monero/ + cd monero + apply_patches + cd $BUILD_ROOT +} + +build () { + cmake -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DARCH=default \ + -DWITH_DESKTOP_ENTRY=OFF \ + -DSTACK_TRACE=OFF \ + . + cmake --build build +} + +package () { + install -Dm755 build/bin/monero-wallet-gui "${PKG_DEST}/usr/bin/monero-wallet-gui" + + install -Dm644 monero-gui.desktop "${PKG_DEST}/usr/share/applications" + for x in 16 24 32 48 64 96 128 256; do + install -Dm644 "images/appicons/${x}x${x}.png" "${PKG_DEST}/usr/share/icons/hicolor/${x}x${x}/apps/monero-gui.png" + done +} diff --git a/repo/monero-gui/system-miniupnpc.patch b/repo/monero-gui/system-miniupnpc.patch new file mode 100644 index 0000000..fc303fb --- /dev/null +++ b/repo/monero-gui/system-miniupnpc.patch @@ -0,0 +1,105 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -547,6 +547,14 @@ + include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") + add_subdirectory(external) + ++# Final setup for miniupnpc ++if(UPNP_STATIC OR IOS) ++ add_definitions("-DUPNP_STATIC") ++else() ++ add_definitions("-DUPNP_DYNAMIC") ++ include_directories(${UPNP_INCLUDE}) ++endif() ++ + # Final setup for libunbound + include_directories(${UNBOUND_INCLUDE}) + link_directories(${UNBOUND_LIBRARY_DIRS}) +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 9b21705e..76340a22 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -61,9 +61,16 @@ + #include "cryptonote_core/cryptonote_core.h" + #include "net/parse.h" + +-#include <miniupnp/miniupnpc/miniupnpc.h> +-#include <miniupnp/miniupnpc/upnpcommands.h> +-#include <miniupnp/miniupnpc/upnperrors.h> ++// We have to look for miniupnpc headers in different places, dependent on if its compiled or external ++#ifdef UPNP_STATIC ++ #include <miniupnp/miniupnpc/miniupnpc.h> ++ #include <miniupnp/miniupnpc/upnpcommands.h> ++ #include <miniupnp/miniupnpc/upnperrors.h> ++#else ++ #include "miniupnpc.h" ++ #include "upnpcommands.h" ++ #include "upnperrors.h" ++#endif + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" +-- +2.17.0 + +--- a/external/CMakeLists.txt 2021-12-04 03:56:51.405517304 +0200 ++++ b/external/CMakeLists.txt 2021-12-04 04:02:37.649484660 +0200 +@@ -34,24 +34,46 @@ + # We always compile if we are building statically to reduce static dependency issues... + # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with + # others. ++if(NOT IOS) ++ find_package(Miniupnpc QUIET) ++endif() + +-find_package(Miniupnpc REQUIRED) +- +-message(STATUS "Using in-tree miniupnpc") +-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) +-add_subdirectory(miniupnp/miniupnpc) +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) +-if(MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") +-elseif(NOT MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") ++# If we have the correct shared version and we're not building static, use it ++if(STATIC OR IOS) ++ set(USE_SHARED_MINIUPNPC false) ++elseif(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) ++ set(USE_SHARED_MINIUPNPC true) + endif() ++ ++ ++if(USE_SHARED_MINIUPNPC) ++ message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}") ++ ++ set(UPNP_STATIC false PARENT_SCOPE) ++ set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) ++ set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) ++else() ++ if(STATIC) ++ message(STATUS "Using miniupnpc from local source tree for static build") ++ else() ++ message(STATUS "Using miniupnpc from local source tree (/external/miniupnp/miniupnpc)") ++ endif() ++ add_subdirectory(miniupnp/miniupnpc) ++ ++ set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") ++ if(MSVC) ++ set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") ++ elseif(NOT MSVC) ++ set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") ++ endif() ++ + if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") + endif() + +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++ set(UPNP_STATIC true PARENT_SCOPE) ++ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++endif() + + find_package(Unbound) + diff --git a/repo/monero-gui/version-string.patch b/repo/monero-gui/version-string.patch new file mode 100644 index 0000000..f64be9d --- /dev/null +++ b/repo/monero-gui/version-string.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/Version.cmake b/cmake/Version.cmake +index 3677e80..490de2c 100644 +--- a/cmake/Version.cmake ++++ b/cmake/Version.cmake +@@ -32,7 +32,7 @@ function (write_static_version_header hash) + endfunction () + + find_package(Git QUIET) +-if ("$Format:$" STREQUAL "") ++if ("$Format:$" STREQUAL "" OR NOT EXISTS .git) + # We're in a tarball; use hard-coded variables. + set(VERSION_IS_RELEASE "true") + write_version("release") diff --git a/repo/monero/easylogging.patch b/repo/monero/easylogging.patch new file mode 100644 index 0000000..3cddc78 --- /dev/null +++ b/repo/monero/easylogging.patch @@ -0,0 +1,11 @@ +--- a/external/easylogging++/easylogging++.h ++++ b/external/easylogging++/easylogging++.h +@@ -221,7 +221,7 @@ + # define ELPP_INTERNAL_INFO(lvl, msg) + #endif // (defined(ELPP_DEBUG_INFO)) + #if (defined(ELPP_FEATURE_ALL)) || (defined(ELPP_FEATURE_CRASH_LOG)) +-# if (ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) ++# if (__has_include(<execinfo.h>) && ELPP_COMPILER_GCC && !ELPP_MINGW && !ELPP_OS_OPENBSD && !ELPP_OS_NETBSD && !ELPP_OS_ANDROID && !ELPP_OS_EMSCRIPTEN) + # define ELPP_STACKTRACE 1 + # else + # define ELPP_STACKTRACE 0 diff --git a/repo/monero/monero.xibuild b/repo/monero/monero.xibuild new file mode 100644 index 0000000..06c09d7 --- /dev/null +++ b/repo/monero/monero.xibuild @@ -0,0 +1,42 @@ +#!/bin/sh + +NAME="monero" +DESC="Secure, private, untraceable cryptocurrency" + +MAKEDEPS=" boost cmake cppzmq hidapi libsodium miniupnpc openpgm openssl rapidjson readline unbound zeromq " + +PKG_VER=0.17.3.0 +_ver_randomx=ae8e98b681766f31d49ac562dd6974906156e07b +_ver_supercop=633500ad8c8759995049ccd022107d1fa8a1bbc9 +SOURCE="https://github.com/monero-project/monero/archive/refs/tags/v$PKG_VER.tar.gz" + +ADDITIONAL=" +easylogging.patch +system-miniupnpc.patch +version-string.patch + +https://github.com/tevador/RandomX/archive/$_ver_randomx.tar.gz +https://github.com/monero-project/supercop/archive/$_ver_supercop.tar.gz" + + +prepare() { + apply_patches + + rm -fr external/randomx external/supercop + ln -s $BUILD_ROOT/RandomX-$_ver_randomx external/randomx + ln -s $BUILD_ROOT/supercop-$_ver_supercop external/supercop +} + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DSTACK_TRACE=OFF \ + -DMANUAL_SUBMODULES=1 + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/monero/system-miniupnpc.patch b/repo/monero/system-miniupnpc.patch new file mode 100644 index 0000000..fc303fb --- /dev/null +++ b/repo/monero/system-miniupnpc.patch @@ -0,0 +1,105 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -547,6 +547,14 @@ + include_directories("${CMAKE_CURRENT_BINARY_DIR}/translations") + add_subdirectory(external) + ++# Final setup for miniupnpc ++if(UPNP_STATIC OR IOS) ++ add_definitions("-DUPNP_STATIC") ++else() ++ add_definitions("-DUPNP_DYNAMIC") ++ include_directories(${UPNP_INCLUDE}) ++endif() ++ + # Final setup for libunbound + include_directories(${UNBOUND_INCLUDE}) + link_directories(${UNBOUND_LIBRARY_DIRS}) +diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl +index 9b21705e..76340a22 100644 +--- a/src/p2p/net_node.inl ++++ b/src/p2p/net_node.inl +@@ -61,9 +61,16 @@ + #include "cryptonote_core/cryptonote_core.h" + #include "net/parse.h" + +-#include <miniupnp/miniupnpc/miniupnpc.h> +-#include <miniupnp/miniupnpc/upnpcommands.h> +-#include <miniupnp/miniupnpc/upnperrors.h> ++// We have to look for miniupnpc headers in different places, dependent on if its compiled or external ++#ifdef UPNP_STATIC ++ #include <miniupnp/miniupnpc/miniupnpc.h> ++ #include <miniupnp/miniupnpc/upnpcommands.h> ++ #include <miniupnp/miniupnpc/upnperrors.h> ++#else ++ #include "miniupnpc.h" ++ #include "upnpcommands.h" ++ #include "upnperrors.h" ++#endif + + #undef MONERO_DEFAULT_LOG_CATEGORY + #define MONERO_DEFAULT_LOG_CATEGORY "net.p2p" +-- +2.17.0 + +--- a/external/CMakeLists.txt 2021-12-04 03:56:51.405517304 +0200 ++++ b/external/CMakeLists.txt 2021-12-04 04:02:37.649484660 +0200 +@@ -34,24 +34,46 @@ + # We always compile if we are building statically to reduce static dependency issues... + # ...except for FreeBSD, because FreeBSD is a special case that doesn't play well with + # others. ++if(NOT IOS) ++ find_package(Miniupnpc QUIET) ++endif() + +-find_package(Miniupnpc REQUIRED) +- +-message(STATUS "Using in-tree miniupnpc") +-set(UPNPC_NO_INSTALL TRUE CACHE BOOL "Disable miniupnp installation" FORCE) +-add_subdirectory(miniupnp/miniupnpc) +-set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") +-set_property(TARGET libminiupnpc-static PROPERTY POSITION_INDEPENDENT_CODE ON) +-if(MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") +-elseif(NOT MSVC) +- set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") ++# If we have the correct shared version and we're not building static, use it ++if(STATIC OR IOS) ++ set(USE_SHARED_MINIUPNPC false) ++elseif(MINIUPNP_FOUND AND MINIUPNPC_VERSION_1_7_OR_HIGHER) ++ set(USE_SHARED_MINIUPNPC true) + endif() ++ ++ ++if(USE_SHARED_MINIUPNPC) ++ message(STATUS "Using shared miniupnpc found at ${MINIUPNP_INCLUDE_DIR}") ++ ++ set(UPNP_STATIC false PARENT_SCOPE) ++ set(UPNP_INCLUDE ${MINIUPNP_INCLUDE_DIR} PARENT_SCOPE) ++ set(UPNP_LIBRARIES ${MINIUPNP_LIBRARY} PARENT_SCOPE) ++else() ++ if(STATIC) ++ message(STATUS "Using miniupnpc from local source tree for static build") ++ else() ++ message(STATUS "Using miniupnpc from local source tree (/external/miniupnp/miniupnpc)") ++ endif() ++ add_subdirectory(miniupnp/miniupnpc) ++ ++ set_property(TARGET libminiupnpc-static PROPERTY FOLDER "external") ++ if(MSVC) ++ set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -wd4244 -wd4267") ++ elseif(NOT MSVC) ++ set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-undef -Wno-unused-result -Wno-unused-value") ++ endif() ++ + if(CMAKE_SYSTEM_NAME MATCHES "NetBSD") + set_property(TARGET libminiupnpc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -D_NETBSD_SOURCE") + endif() + +-set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++ set(UPNP_STATIC true PARENT_SCOPE) ++ set(UPNP_LIBRARIES "libminiupnpc-static" PARENT_SCOPE) ++endif() + + find_package(Unbound) + diff --git a/repo/monero/version-string.patch b/repo/monero/version-string.patch new file mode 100644 index 0000000..f64be9d --- /dev/null +++ b/repo/monero/version-string.patch @@ -0,0 +1,13 @@ +diff --git a/cmake/Version.cmake b/cmake/Version.cmake +index 3677e80..490de2c 100644 +--- a/cmake/Version.cmake ++++ b/cmake/Version.cmake +@@ -32,7 +32,7 @@ function (write_static_version_header hash) + endfunction () + + find_package(Git QUIET) +-if ("$Format:$" STREQUAL "") ++if ("$Format:$" STREQUAL "" OR NOT EXISTS .git) + # We're in a tarball; use hard-coded variables. + set(VERSION_IS_RELEASE "true") + write_version("release") diff --git a/repo/mtxclient/mtxclient.xibuild b/repo/mtxclient/mtxclient.xibuild new file mode 100644 index 0000000..efb50c1 --- /dev/null +++ b/repo/mtxclient/mtxclient.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="mtxclient" +DESC="Client API library for Matrix, built on top of Boost.Asio" + +MAKEDEPS="boost coeurl libsodium nlohmann-json olm openssl zlib cmake" + +PKG_VER=0.7.0 +SOURCE="https://github.com/nheko-reborn/mtxclient/archive/v$PKG_VER/mtxclient-v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_LIB_EXAMPLES=OFF + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + + diff --git a/repo/musl-legacy-compat/cdefs.h b/repo/musl-legacy-compat/cdefs.h new file mode 100644 index 0000000..841a5da --- /dev/null +++ b/repo/musl-legacy-compat/cdefs.h @@ -0,0 +1,34 @@ +#ifndef _SYS_CDEFS_H_ +#define _SYS_CDEFS_H_ + +#warning usage of non-standard #include <sys/cdefs.h> is deprecated + +#undef __P +#undef __PMT + +#define __P(args) args +#define __PMT(args) args + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#ifdef __cplusplus +# define __BEGIN_DECLS extern "C" { +# define __END_DECLS } +#else +# define __BEGIN_DECLS +# define __END_DECLS +#endif + +#if defined(__GNUC__) && !defined(__cplusplus) +# define __THROW __attribute__ ((__nothrow__)) +# define __NTH(fct) __attribute__ ((__nothrow__)) fct +#else +# define __THROW +# define __NTH(fct) fct +#endif + +#define __CONCAT(x,y) x ## y +#define __STRING(x) #x + +#endif /* _SYS_CDEFS_H_ */ diff --git a/repo/musl-legacy-compat/musl-legacy-compat.xibuild b/repo/musl-legacy-compat/musl-legacy-compat.xibuild index 00ecaa1..eede288 100644 --- a/repo/musl-legacy-compat/musl-legacy-compat.xibuild +++ b/repo/musl-legacy-compat/musl-legacy-compat.xibuild @@ -3,19 +3,19 @@ MAKEDEPS="" DEPS="musl" -HEADER_SOURCE="https://raw.githubusercontent.com/void-linux/void-packages/master/srcpkgs/musl-legacy-compat/files" +SOURCE="" ADDITIONAL=" - $HEADER_SOURCE/cdefs.h - $HEADER_SOURCE/queue.h - $HEADER_SOURCE/tree.h + cdefs.h + queue.h + tree.h " DESC="Legacy compatibility headers for musl" package () { - for h in cdefs queue tree - do - install -D -m644 $h.h $PKG_DEST/usr/include/sys + install -d $PKG_DEST/usr/include/sys + for h in cdefs queue tree; do + install -Dm644 $h.h $PKG_DEST/usr/include/sys done } diff --git a/repo/musl-legacy-compat/queue.h b/repo/musl-legacy-compat/queue.h new file mode 100644 index 0000000..99d01a5 --- /dev/null +++ b/repo/musl-legacy-compat/queue.h @@ -0,0 +1,846 @@ +/* $NetBSD: queue.h,v 1.68 2014/11/19 08:10:01 uebayasi Exp $ */ + +/* + * Copyright (c) 1991, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)queue.h 8.5 (Berkeley) 8/20/94 + */ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +/* + * This file defines five types of data structures: singly-linked lists, + * lists, simple queues, tail queues, and circular queues. + * + * A singly-linked list is headed by a single forward pointer. The + * elements are singly linked for minimum space and pointer manipulation + * overhead at the expense of O(n) removal for arbitrary elements. New + * elements can be added to the list after an existing element or at the + * head of the list. Elements being removed from the head of the list + * should use the explicit macro for this purpose for optimum + * efficiency. A singly-linked list may only be traversed in the forward + * direction. Singly-linked lists are ideal for applications with large + * datasets and few or no removals or for implementing a LIFO queue. + * + * A list is headed by a single forward pointer (or an array of forward + * pointers for a hash table header). The elements are doubly linked + * so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before + * or after an existing element or at the head of the list. A list + * may only be traversed in the forward direction. + * + * A simple queue is headed by a pair of pointers, one the head of the + * list and the other to the tail of the list. The elements are singly + * linked to save space, so elements can only be removed from the + * head of the list. New elements can be added to the list after + * an existing element, at the head of the list, or at the end of the + * list. A simple queue may only be traversed in the forward direction. + * + * A tail queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or + * after an existing element, at the head of the list, or at the end of + * the list. A tail queue may be traversed in either direction. + * + * A circle queue is headed by a pair of pointers, one to the head of the + * list and the other to the tail of the list. The elements are doubly + * linked so that an arbitrary element can be removed without a need to + * traverse the list. New elements can be added to the list before or after + * an existing element, at the head of the list, or at the end of the list. + * A circle queue may be traversed in either direction, but has a more + * complex end of list detection. + * + * For details on the use of these macros, see the queue(3) manual page. + */ + +/* + * Include the definition of NULL only on NetBSD because sys/null.h + * is not available elsewhere. This conditional makes the header + * portable and it can simply be dropped verbatim into any system. + * The caveat is that on other systems some other header + * must provide NULL before the macros can be used. + */ +#ifdef __NetBSD__ +#include <sys/null.h> +#endif + +#if defined(QUEUEDEBUG) +# if defined(_KERNEL) +# define QUEUEDEBUG_ABORT(...) panic(__VA_ARGS__) +# else +# include <err.h> +# define QUEUEDEBUG_ABORT(...) err(1, __VA_ARGS__) +# endif +#endif + +/* + * Singly-linked List definitions. + */ +#define SLIST_HEAD(name, type) \ +struct name { \ + struct type *slh_first; /* first element */ \ +} + +#define SLIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define SLIST_ENTRY(type) \ +struct { \ + struct type *sle_next; /* next element */ \ +} + +/* + * Singly-linked List access methods. + */ +#define SLIST_FIRST(head) ((head)->slh_first) +#define SLIST_END(head) NULL +#define SLIST_EMPTY(head) ((head)->slh_first == NULL) +#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) + +#define SLIST_FOREACH(var, head, field) \ + for((var) = (head)->slh_first; \ + (var) != SLIST_END(head); \ + (var) = (var)->field.sle_next) + +#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = SLIST_FIRST((head)); \ + (var) != SLIST_END(head) && \ + ((tvar) = SLIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +/* + * Singly-linked List functions. + */ +#define SLIST_INIT(head) do { \ + (head)->slh_first = SLIST_END(head); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ + (elm)->field.sle_next = (slistelm)->field.sle_next; \ + (slistelm)->field.sle_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_INSERT_HEAD(head, elm, field) do { \ + (elm)->field.sle_next = (head)->slh_first; \ + (head)->slh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_AFTER(slistelm, field) do { \ + (slistelm)->field.sle_next = \ + SLIST_NEXT(SLIST_NEXT((slistelm), field), field); \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE_HEAD(head, field) do { \ + (head)->slh_first = (head)->slh_first->field.sle_next; \ +} while (/*CONSTCOND*/0) + +#define SLIST_REMOVE(head, elm, type, field) do { \ + if ((head)->slh_first == (elm)) { \ + SLIST_REMOVE_HEAD((head), field); \ + } \ + else { \ + struct type *curelm = (head)->slh_first; \ + while(curelm->field.sle_next != (elm)) \ + curelm = curelm->field.sle_next; \ + curelm->field.sle_next = \ + curelm->field.sle_next->field.sle_next; \ + } \ +} while (/*CONSTCOND*/0) + + +/* + * List definitions. + */ +#define LIST_HEAD(name, type) \ +struct name { \ + struct type *lh_first; /* first element */ \ +} + +#define LIST_HEAD_INITIALIZER(head) \ + { NULL } + +#define LIST_ENTRY(type) \ +struct { \ + struct type *le_next; /* next element */ \ + struct type **le_prev; /* address of previous next element */ \ +} + +/* + * List access methods. + */ +#define LIST_FIRST(head) ((head)->lh_first) +#define LIST_END(head) NULL +#define LIST_EMPTY(head) ((head)->lh_first == LIST_END(head)) +#define LIST_NEXT(elm, field) ((elm)->field.le_next) + +#define LIST_FOREACH(var, head, field) \ + for ((var) = ((head)->lh_first); \ + (var) != LIST_END(head); \ + (var) = ((var)->field.le_next)) + +#define LIST_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = LIST_FIRST((head)); \ + (var) != LIST_END(head) && \ + ((tvar) = LIST_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define LIST_MOVE(head1, head2) do { \ + LIST_INIT((head2)); \ + if (!LIST_EMPTY((head1))) { \ + (head2)->lh_first = (head1)->lh_first; \ + LIST_INIT((head1)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * List functions. + */ +#if defined(QUEUEDEBUG) +#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) \ + if ((head)->lh_first && \ + (head)->lh_first->field.le_prev != &(head)->lh_first) \ + QUEUEDEBUG_ABORT("LIST_INSERT_HEAD %p %s:%d", (head), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_LIST_OP(elm, field) \ + if ((elm)->field.le_next && \ + (elm)->field.le_next->field.le_prev != \ + &(elm)->field.le_next) \ + QUEUEDEBUG_ABORT("LIST_* forw %p %s:%d", (elm), \ + __FILE__, __LINE__); \ + if (*(elm)->field.le_prev != (elm)) \ + QUEUEDEBUG_ABORT("LIST_* back %p %s:%d", (elm), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) \ + (elm)->field.le_next = (void *)1L; \ + (elm)->field.le_prev = (void *)1L; +#else +#define QUEUEDEBUG_LIST_INSERT_HEAD(head, elm, field) +#define QUEUEDEBUG_LIST_OP(elm, field) +#define QUEUEDEBUG_LIST_POSTREMOVE(elm, field) +#endif + +#define LIST_INIT(head) do { \ + (head)->lh_first = LIST_END(head); \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_AFTER(listelm, elm, field) do { \ + QUEUEDEBUG_LIST_OP((listelm), field) \ + if (((elm)->field.le_next = (listelm)->field.le_next) != \ + LIST_END(head)) \ + (listelm)->field.le_next->field.le_prev = \ + &(elm)->field.le_next; \ + (listelm)->field.le_next = (elm); \ + (elm)->field.le_prev = &(listelm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ + QUEUEDEBUG_LIST_OP((listelm), field) \ + (elm)->field.le_prev = (listelm)->field.le_prev; \ + (elm)->field.le_next = (listelm); \ + *(listelm)->field.le_prev = (elm); \ + (listelm)->field.le_prev = &(elm)->field.le_next; \ +} while (/*CONSTCOND*/0) + +#define LIST_INSERT_HEAD(head, elm, field) do { \ + QUEUEDEBUG_LIST_INSERT_HEAD((head), (elm), field) \ + if (((elm)->field.le_next = (head)->lh_first) != LIST_END(head))\ + (head)->lh_first->field.le_prev = &(elm)->field.le_next;\ + (head)->lh_first = (elm); \ + (elm)->field.le_prev = &(head)->lh_first; \ +} while (/*CONSTCOND*/0) + +#define LIST_REMOVE(elm, field) do { \ + QUEUEDEBUG_LIST_OP((elm), field) \ + if ((elm)->field.le_next != NULL) \ + (elm)->field.le_next->field.le_prev = \ + (elm)->field.le_prev; \ + *(elm)->field.le_prev = (elm)->field.le_next; \ + QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \ +} while (/*CONSTCOND*/0) + +#define LIST_REPLACE(elm, elm2, field) do { \ + if (((elm2)->field.le_next = (elm)->field.le_next) != NULL) \ + (elm2)->field.le_next->field.le_prev = \ + &(elm2)->field.le_next; \ + (elm2)->field.le_prev = (elm)->field.le_prev; \ + *(elm2)->field.le_prev = (elm2); \ + QUEUEDEBUG_LIST_POSTREMOVE((elm), field) \ +} while (/*CONSTCOND*/0) + +/* + * Simple queue definitions. + */ +#define SIMPLEQ_HEAD(name, type) \ +struct name { \ + struct type *sqh_first; /* first element */ \ + struct type **sqh_last; /* addr of last next element */ \ +} + +#define SIMPLEQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).sqh_first } + +#define SIMPLEQ_ENTRY(type) \ +struct { \ + struct type *sqe_next; /* next element */ \ +} + +/* + * Simple queue access methods. + */ +#define SIMPLEQ_FIRST(head) ((head)->sqh_first) +#define SIMPLEQ_END(head) NULL +#define SIMPLEQ_EMPTY(head) ((head)->sqh_first == SIMPLEQ_END(head)) +#define SIMPLEQ_NEXT(elm, field) ((elm)->field.sqe_next) + +#define SIMPLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->sqh_first); \ + (var) != SIMPLEQ_END(head); \ + (var) = ((var)->field.sqe_next)) + +#define SIMPLEQ_FOREACH_SAFE(var, head, field, next) \ + for ((var) = ((head)->sqh_first); \ + (var) != SIMPLEQ_END(head) && \ + ((next = ((var)->field.sqe_next)), 1); \ + (var) = (next)) + +/* + * Simple queue functions. + */ +#define SIMPLEQ_INIT(head) do { \ + (head)->sqh_first = NULL; \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.sqe_next = (head)->sqh_first) == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (head)->sqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.sqe_next = NULL; \ + *(head)->sqh_last = (elm); \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.sqe_next = (listelm)->field.sqe_next) == NULL)\ + (head)->sqh_last = &(elm)->field.sqe_next; \ + (listelm)->field.sqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_HEAD(head, field) do { \ + if (((head)->sqh_first = (head)->sqh_first->field.sqe_next) == NULL) \ + (head)->sqh_last = &(head)->sqh_first; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE_AFTER(head, elm, field) do { \ + if (((elm)->field.sqe_next = (elm)->field.sqe_next->field.sqe_next) \ + == NULL) \ + (head)->sqh_last = &(elm)->field.sqe_next; \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_REMOVE(head, elm, type, field) do { \ + if ((head)->sqh_first == (elm)) { \ + SIMPLEQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->sqh_first; \ + while (curelm->field.sqe_next != (elm)) \ + curelm = curelm->field.sqe_next; \ + if ((curelm->field.sqe_next = \ + curelm->field.sqe_next->field.sqe_next) == NULL) \ + (head)->sqh_last = &(curelm)->field.sqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_CONCAT(head1, head2) do { \ + if (!SIMPLEQ_EMPTY((head2))) { \ + *(head1)->sqh_last = (head2)->sqh_first; \ + (head1)->sqh_last = (head2)->sqh_last; \ + SIMPLEQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +#define SIMPLEQ_LAST(head, type, field) \ + (SIMPLEQ_EMPTY((head)) ? \ + NULL : \ + ((struct type *)(void *) \ + ((char *)((head)->sqh_last) - offsetof(struct type, field)))) + +/* + * Tail queue definitions. + */ +#define _TAILQ_HEAD(name, type, qual) \ +struct name { \ + qual type *tqh_first; /* first element */ \ + qual type *qual *tqh_last; /* addr of last next element */ \ +} +#define TAILQ_HEAD(name, type) _TAILQ_HEAD(name, struct type,) + +#define TAILQ_HEAD_INITIALIZER(head) \ + { TAILQ_END(head), &(head).tqh_first } + +#define _TAILQ_ENTRY(type, qual) \ +struct { \ + qual type *tqe_next; /* next element */ \ + qual type *qual *tqe_prev; /* address of previous next element */\ +} +#define TAILQ_ENTRY(type) _TAILQ_ENTRY(struct type,) + +/* + * Tail queue access methods. + */ +#define TAILQ_FIRST(head) ((head)->tqh_first) +#define TAILQ_END(head) (NULL) +#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) +#define TAILQ_LAST(head, headname) \ + (*(((struct headname *)((head)->tqh_last))->tqh_last)) +#define TAILQ_PREV(elm, headname, field) \ + (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) +#define TAILQ_EMPTY(head) (TAILQ_FIRST(head) == TAILQ_END(head)) + + +#define TAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->tqh_first); \ + (var) != TAILQ_END(head); \ + (var) = ((var)->field.tqe_next)) + +#define TAILQ_FOREACH_SAFE(var, head, field, next) \ + for ((var) = ((head)->tqh_first); \ + (var) != TAILQ_END(head) && \ + ((next) = TAILQ_NEXT(var, field), 1); (var) = (next)) + +#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ + for ((var) = (*(((struct headname *)((head)->tqh_last))->tqh_last));\ + (var) != TAILQ_END(head); \ + (var) = (*(((struct headname *)((var)->field.tqe_prev))->tqh_last))) + +#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, prev) \ + for ((var) = TAILQ_LAST((head), headname); \ + (var) != TAILQ_END(head) && \ + ((prev) = TAILQ_PREV((var), headname, field), 1); (var) = (prev)) + +/* + * Tail queue functions. + */ +#if defined(QUEUEDEBUG) +#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) \ + if ((head)->tqh_first && \ + (head)->tqh_first->field.tqe_prev != &(head)->tqh_first) \ + QUEUEDEBUG_ABORT("TAILQ_INSERT_HEAD %p %s:%d", (head), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) \ + if (*(head)->tqh_last != NULL) \ + QUEUEDEBUG_ABORT("TAILQ_INSERT_TAIL %p %s:%d", (head), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_TAILQ_OP(elm, field) \ + if ((elm)->field.tqe_next && \ + (elm)->field.tqe_next->field.tqe_prev != \ + &(elm)->field.tqe_next) \ + QUEUEDEBUG_ABORT("TAILQ_* forw %p %s:%d", (elm), \ + __FILE__, __LINE__); \ + if (*(elm)->field.tqe_prev != (elm)) \ + QUEUEDEBUG_ABORT("TAILQ_* back %p %s:%d", (elm), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) \ + if ((elm)->field.tqe_next == NULL && \ + (head)->tqh_last != &(elm)->field.tqe_next) \ + QUEUEDEBUG_ABORT("TAILQ_PREREMOVE head %p elm %p %s:%d",\ + (head), (elm), __FILE__, __LINE__); +#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) \ + (elm)->field.tqe_next = (void *)1L; \ + (elm)->field.tqe_prev = (void *)1L; +#else +#define QUEUEDEBUG_TAILQ_INSERT_HEAD(head, elm, field) +#define QUEUEDEBUG_TAILQ_INSERT_TAIL(head, elm, field) +#define QUEUEDEBUG_TAILQ_OP(elm, field) +#define QUEUEDEBUG_TAILQ_PREREMOVE(head, elm, field) +#define QUEUEDEBUG_TAILQ_POSTREMOVE(elm, field) +#endif + +#define TAILQ_INIT(head) do { \ + (head)->tqh_first = TAILQ_END(head); \ + (head)->tqh_last = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_HEAD(head, elm, field) do { \ + QUEUEDEBUG_TAILQ_INSERT_HEAD((head), (elm), field) \ + if (((elm)->field.tqe_next = (head)->tqh_first) != TAILQ_END(head))\ + (head)->tqh_first->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (head)->tqh_first = (elm); \ + (elm)->field.tqe_prev = &(head)->tqh_first; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_TAIL(head, elm, field) do { \ + QUEUEDEBUG_TAILQ_INSERT_TAIL((head), (elm), field) \ + (elm)->field.tqe_next = TAILQ_END(head); \ + (elm)->field.tqe_prev = (head)->tqh_last; \ + *(head)->tqh_last = (elm); \ + (head)->tqh_last = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + QUEUEDEBUG_TAILQ_OP((listelm), field) \ + if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != \ + TAILQ_END(head)) \ + (elm)->field.tqe_next->field.tqe_prev = \ + &(elm)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm)->field.tqe_next; \ + (listelm)->field.tqe_next = (elm); \ + (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ + QUEUEDEBUG_TAILQ_OP((listelm), field) \ + (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ + (elm)->field.tqe_next = (listelm); \ + *(listelm)->field.tqe_prev = (elm); \ + (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REMOVE(head, elm, field) do { \ + QUEUEDEBUG_TAILQ_PREREMOVE((head), (elm), field) \ + QUEUEDEBUG_TAILQ_OP((elm), field) \ + if (((elm)->field.tqe_next) != TAILQ_END(head)) \ + (elm)->field.tqe_next->field.tqe_prev = \ + (elm)->field.tqe_prev; \ + else \ + (head)->tqh_last = (elm)->field.tqe_prev; \ + *(elm)->field.tqe_prev = (elm)->field.tqe_next; \ + QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \ +} while (/*CONSTCOND*/0) + +#define TAILQ_REPLACE(head, elm, elm2, field) do { \ + if (((elm2)->field.tqe_next = (elm)->field.tqe_next) != \ + TAILQ_END(head)) \ + (elm2)->field.tqe_next->field.tqe_prev = \ + &(elm2)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm2)->field.tqe_next; \ + (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ + *(elm2)->field.tqe_prev = (elm2); \ + QUEUEDEBUG_TAILQ_POSTREMOVE((elm), field); \ +} while (/*CONSTCOND*/0) + +#define TAILQ_CONCAT(head1, head2, field) do { \ + if (!TAILQ_EMPTY(head2)) { \ + *(head1)->tqh_last = (head2)->tqh_first; \ + (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ + (head1)->tqh_last = (head2)->tqh_last; \ + TAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +/* + * Singly-linked Tail queue declarations. + */ +#define STAILQ_HEAD(name, type) \ +struct name { \ + struct type *stqh_first; /* first element */ \ + struct type **stqh_last; /* addr of last next element */ \ +} + +#define STAILQ_HEAD_INITIALIZER(head) \ + { NULL, &(head).stqh_first } + +#define STAILQ_ENTRY(type) \ +struct { \ + struct type *stqe_next; /* next element */ \ +} + +/* + * Singly-linked Tail queue access methods. + */ +#define STAILQ_FIRST(head) ((head)->stqh_first) +#define STAILQ_END(head) NULL +#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) +#define STAILQ_EMPTY(head) (STAILQ_FIRST(head) == STAILQ_END(head)) + +/* + * Singly-linked Tail queue functions. + */ +#define STAILQ_INIT(head) do { \ + (head)->stqh_first = NULL; \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_HEAD(head, elm, field) do { \ + if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (head)->stqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_TAIL(head, elm, field) do { \ + (elm)->field.stqe_next = NULL; \ + *(head)->stqh_last = (elm); \ + (head)->stqh_last = &(elm)->field.stqe_next; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ + if (((elm)->field.stqe_next = (listelm)->field.stqe_next) == NULL)\ + (head)->stqh_last = &(elm)->field.stqe_next; \ + (listelm)->field.stqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE_HEAD(head, field) do { \ + if (((head)->stqh_first = (head)->stqh_first->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (/*CONSTCOND*/0) + +#define STAILQ_REMOVE(head, elm, type, field) do { \ + if ((head)->stqh_first == (elm)) { \ + STAILQ_REMOVE_HEAD((head), field); \ + } else { \ + struct type *curelm = (head)->stqh_first; \ + while (curelm->field.stqe_next != (elm)) \ + curelm = curelm->field.stqe_next; \ + if ((curelm->field.stqe_next = \ + curelm->field.stqe_next->field.stqe_next) == NULL) \ + (head)->stqh_last = &(curelm)->field.stqe_next; \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_FOREACH(var, head, field) \ + for ((var) = ((head)->stqh_first); \ + (var); \ + (var) = ((var)->field.stqe_next)) + +#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ + for ((var) = STAILQ_FIRST((head)); \ + (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ + (var) = (tvar)) + +#define STAILQ_CONCAT(head1, head2) do { \ + if (!STAILQ_EMPTY((head2))) { \ + *(head1)->stqh_last = (head2)->stqh_first; \ + (head1)->stqh_last = (head2)->stqh_last; \ + STAILQ_INIT((head2)); \ + } \ +} while (/*CONSTCOND*/0) + +#define STAILQ_LAST(head, type, field) \ + (STAILQ_EMPTY((head)) ? \ + NULL : \ + ((struct type *)(void *) \ + ((char *)((head)->stqh_last) - offsetof(struct type, field)))) + + +#ifndef _KERNEL +/* + * Circular queue definitions. Do not use. We still keep the macros + * for compatibility but because of pointer aliasing issues their use + * is discouraged! + */ + +/* + * __launder_type(): We use this ugly hack to work around the the compiler + * noticing that two types may not alias each other and elide tests in code. + * We hit this in the CIRCLEQ macros when comparing 'struct name *' and + * 'struct type *' (see CIRCLEQ_HEAD()). Modern compilers (such as GCC + * 4.8) declare these comparisons as always false, causing the code to + * not run as designed. + * + * This hack is only to be used for comparisons and thus can be fully const. + * Do not use for assignment. + * + * If we ever choose to change the ABI of the CIRCLEQ macros, we could fix + * this by changing the head/tail sentinal values, but see the note above + * this one. + */ +static __inline const void * __launder_type(const void *); +static __inline const void * +__launder_type(const void *__x) +{ + __asm __volatile("" : "+r" (__x)); + return __x; +} + +#if defined(QUEUEDEBUG) +#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) \ + if ((head)->cqh_first != CIRCLEQ_ENDC(head) && \ + (head)->cqh_first->field.cqe_prev != CIRCLEQ_ENDC(head)) \ + QUEUEDEBUG_ABORT("CIRCLEQ head forw %p %s:%d", (head), \ + __FILE__, __LINE__); \ + if ((head)->cqh_last != CIRCLEQ_ENDC(head) && \ + (head)->cqh_last->field.cqe_next != CIRCLEQ_ENDC(head)) \ + QUEUEDEBUG_ABORT("CIRCLEQ head back %p %s:%d", (head), \ + __FILE__, __LINE__); +#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) \ + if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) { \ + if ((head)->cqh_last != (elm)) \ + QUEUEDEBUG_ABORT("CIRCLEQ elm last %p %s:%d", \ + (elm), __FILE__, __LINE__); \ + } else { \ + if ((elm)->field.cqe_next->field.cqe_prev != (elm)) \ + QUEUEDEBUG_ABORT("CIRCLEQ elm forw %p %s:%d", \ + (elm), __FILE__, __LINE__); \ + } \ + if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) { \ + if ((head)->cqh_first != (elm)) \ + QUEUEDEBUG_ABORT("CIRCLEQ elm first %p %s:%d", \ + (elm), __FILE__, __LINE__); \ + } else { \ + if ((elm)->field.cqe_prev->field.cqe_next != (elm)) \ + QUEUEDEBUG_ABORT("CIRCLEQ elm prev %p %s:%d", \ + (elm), __FILE__, __LINE__); \ + } +#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) \ + (elm)->field.cqe_next = (void *)1L; \ + (elm)->field.cqe_prev = (void *)1L; +#else +#define QUEUEDEBUG_CIRCLEQ_HEAD(head, field) +#define QUEUEDEBUG_CIRCLEQ_ELM(head, elm, field) +#define QUEUEDEBUG_CIRCLEQ_POSTREMOVE(elm, field) +#endif + +#define CIRCLEQ_HEAD(name, type) \ +struct name { \ + struct type *cqh_first; /* first element */ \ + struct type *cqh_last; /* last element */ \ +} + +#define CIRCLEQ_HEAD_INITIALIZER(head) \ + { CIRCLEQ_END(&head), CIRCLEQ_END(&head) } + +#define CIRCLEQ_ENTRY(type) \ +struct { \ + struct type *cqe_next; /* next element */ \ + struct type *cqe_prev; /* previous element */ \ +} + +/* + * Circular queue functions. + */ +#define CIRCLEQ_INIT(head) do { \ + (head)->cqh_first = CIRCLEQ_END(head); \ + (head)->cqh_last = CIRCLEQ_END(head); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \ + QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ + QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \ + (elm)->field.cqe_next = (listelm)->field.cqe_next; \ + (elm)->field.cqe_prev = (listelm); \ + if ((listelm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ + (head)->cqh_last = (elm); \ + else \ + (listelm)->field.cqe_next->field.cqe_prev = (elm); \ + (listelm)->field.cqe_next = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \ + QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ + QUEUEDEBUG_CIRCLEQ_ELM((head), (listelm), field) \ + (elm)->field.cqe_next = (listelm); \ + (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \ + if ((listelm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ + (head)->cqh_first = (elm); \ + else \ + (listelm)->field.cqe_prev->field.cqe_next = (elm); \ + (listelm)->field.cqe_prev = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \ + QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ + (elm)->field.cqe_next = (head)->cqh_first; \ + (elm)->field.cqe_prev = CIRCLEQ_END(head); \ + if ((head)->cqh_last == CIRCLEQ_ENDC(head)) \ + (head)->cqh_last = (elm); \ + else \ + (head)->cqh_first->field.cqe_prev = (elm); \ + (head)->cqh_first = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \ + QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ + (elm)->field.cqe_next = CIRCLEQ_END(head); \ + (elm)->field.cqe_prev = (head)->cqh_last; \ + if ((head)->cqh_first == CIRCLEQ_ENDC(head)) \ + (head)->cqh_first = (elm); \ + else \ + (head)->cqh_last->field.cqe_next = (elm); \ + (head)->cqh_last = (elm); \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_REMOVE(head, elm, field) do { \ + QUEUEDEBUG_CIRCLEQ_HEAD((head), field) \ + QUEUEDEBUG_CIRCLEQ_ELM((head), (elm), field) \ + if ((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ + (head)->cqh_last = (elm)->field.cqe_prev; \ + else \ + (elm)->field.cqe_next->field.cqe_prev = \ + (elm)->field.cqe_prev; \ + if ((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ + (head)->cqh_first = (elm)->field.cqe_next; \ + else \ + (elm)->field.cqe_prev->field.cqe_next = \ + (elm)->field.cqe_next; \ + QUEUEDEBUG_CIRCLEQ_POSTREMOVE((elm), field) \ +} while (/*CONSTCOND*/0) + +#define CIRCLEQ_FOREACH(var, head, field) \ + for ((var) = ((head)->cqh_first); \ + (var) != CIRCLEQ_ENDC(head); \ + (var) = ((var)->field.cqe_next)) + +#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \ + for ((var) = ((head)->cqh_last); \ + (var) != CIRCLEQ_ENDC(head); \ + (var) = ((var)->field.cqe_prev)) + +/* + * Circular queue access methods. + */ +#define CIRCLEQ_FIRST(head) ((head)->cqh_first) +#define CIRCLEQ_LAST(head) ((head)->cqh_last) +/* For comparisons */ +#define CIRCLEQ_ENDC(head) (__launder_type(head)) +/* For assignments */ +#define CIRCLEQ_END(head) ((void *)(head)) +#define CIRCLEQ_NEXT(elm, field) ((elm)->field.cqe_next) +#define CIRCLEQ_PREV(elm, field) ((elm)->field.cqe_prev) +#define CIRCLEQ_EMPTY(head) \ + (CIRCLEQ_FIRST(head) == CIRCLEQ_ENDC(head)) + +#define CIRCLEQ_LOOP_NEXT(head, elm, field) \ + (((elm)->field.cqe_next == CIRCLEQ_ENDC(head)) \ + ? ((head)->cqh_first) \ + : (elm->field.cqe_next)) +#define CIRCLEQ_LOOP_PREV(head, elm, field) \ + (((elm)->field.cqe_prev == CIRCLEQ_ENDC(head)) \ + ? ((head)->cqh_last) \ + : (elm->field.cqe_prev)) +#endif /* !_KERNEL */ + +#endif /* !_SYS_QUEUE_H_ */ diff --git a/repo/musl-legacy-compat/tree.h b/repo/musl-legacy-compat/tree.h new file mode 100644 index 0000000..eaea56a --- /dev/null +++ b/repo/musl-legacy-compat/tree.h @@ -0,0 +1,761 @@ +/* $NetBSD: tree.h,v 1.20 2013/09/14 13:20:45 joerg Exp $ */ +/* $OpenBSD: tree.h,v 1.13 2011/07/09 00:19:45 pirofti Exp $ */ +/* + * Copyright 2002 Niels Provos <provos@citi.umich.edu> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef _SYS_TREE_H_ +#define _SYS_TREE_H_ + +/* + * This file defines data structures for different types of trees: + * splay trees and red-black trees. + * + * A splay tree is a self-organizing data structure. Every operation + * on the tree causes a splay to happen. The splay moves the requested + * node to the root of the tree and partly rebalances it. + * + * This has the benefit that request locality causes faster lookups as + * the requested nodes move to the top of the tree. On the other hand, + * every lookup causes memory writes. + * + * The Balance Theorem bounds the total access time for m operations + * and n inserts on an initially empty tree as O((m + n)lg n). The + * amortized cost for a sequence of m accesses to a splay tree is O(lg n); + * + * A red-black tree is a binary search tree with the node color as an + * extra attribute. It fulfills a set of conditions: + * - every search path from the root to a leaf consists of the + * same number of black nodes, + * - each red node (except for the root) has a black parent, + * - each leaf node is black. + * + * Every operation on a red-black tree is bounded as O(lg n). + * The maximum height of a red-black tree is 2lg (n+1). + */ + +#define SPLAY_HEAD(name, type) \ +struct name { \ + struct type *sph_root; /* root of the tree */ \ +} + +#define SPLAY_INITIALIZER(root) \ + { NULL } + +#define SPLAY_INIT(root) do { \ + (root)->sph_root = NULL; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ENTRY(type) \ +struct { \ + struct type *spe_left; /* left element */ \ + struct type *spe_right; /* right element */ \ +} + +#define SPLAY_LEFT(elm, field) (elm)->field.spe_left +#define SPLAY_RIGHT(elm, field) (elm)->field.spe_right +#define SPLAY_ROOT(head) (head)->sph_root +#define SPLAY_EMPTY(head) (SPLAY_ROOT(head) == NULL) + +/* SPLAY_ROTATE_{LEFT,RIGHT} expect that tmp hold SPLAY_{RIGHT,LEFT} */ +#define SPLAY_ROTATE_RIGHT(head, tmp, field) do { \ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(tmp, field); \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ROTATE_LEFT(head, tmp, field) do { \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(tmp, field); \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + (head)->sph_root = tmp; \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKLEFT(head, tmp, field) do { \ + SPLAY_LEFT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field); \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_LINKRIGHT(head, tmp, field) do { \ + SPLAY_RIGHT(tmp, field) = (head)->sph_root; \ + tmp = (head)->sph_root; \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field); \ +} while (/*CONSTCOND*/ 0) + +#define SPLAY_ASSEMBLE(head, node, left, right, field) do { \ + SPLAY_RIGHT(left, field) = SPLAY_LEFT((head)->sph_root, field); \ + SPLAY_LEFT(right, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT((head)->sph_root, field) = SPLAY_RIGHT(node, field); \ + SPLAY_RIGHT((head)->sph_root, field) = SPLAY_LEFT(node, field); \ +} while (/*CONSTCOND*/ 0) + +/* Generates prototypes and inline functions */ + +#define SPLAY_PROTOTYPE(name, type, field, cmp) \ +void name##_SPLAY(struct name *, struct type *); \ +void name##_SPLAY_MINMAX(struct name *, int); \ +struct type *name##_SPLAY_INSERT(struct name *, struct type *); \ +struct type *name##_SPLAY_REMOVE(struct name *, struct type *); \ + \ +/* Finds the node with the same key as elm */ \ +static __inline struct type * \ +name##_SPLAY_FIND(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) \ + return(NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) \ + return (head->sph_root); \ + return (NULL); \ +} \ + \ +static __inline __unused struct type * \ +name##_SPLAY_NEXT(struct name *head, struct type *elm) \ +{ \ + name##_SPLAY(head, elm); \ + if (SPLAY_RIGHT(elm, field) != NULL) { \ + elm = SPLAY_RIGHT(elm, field); \ + while (SPLAY_LEFT(elm, field) != NULL) { \ + elm = SPLAY_LEFT(elm, field); \ + } \ + } else \ + elm = NULL; \ + return (elm); \ +} \ + \ +static __unused __inline struct type * \ +name##_SPLAY_MIN_MAX(struct name *head, int val) \ +{ \ + name##_SPLAY_MINMAX(head, val); \ + return (SPLAY_ROOT(head)); \ +} + +/* Main splay operation. + * Moves node close to the key of elm to top + */ +#define SPLAY_GENERATE(name, type, field, cmp) \ +struct type * \ +name##_SPLAY_INSERT(struct name *head, struct type *elm) \ +{ \ + if (SPLAY_EMPTY(head)) { \ + SPLAY_LEFT(elm, field) = SPLAY_RIGHT(elm, field) = NULL; \ + } else { \ + int __comp; \ + name##_SPLAY(head, elm); \ + __comp = (cmp)(elm, (head)->sph_root); \ + if(__comp < 0) { \ + SPLAY_LEFT(elm, field) = SPLAY_LEFT((head)->sph_root, field);\ + SPLAY_RIGHT(elm, field) = (head)->sph_root; \ + SPLAY_LEFT((head)->sph_root, field) = NULL; \ + } else if (__comp > 0) { \ + SPLAY_RIGHT(elm, field) = SPLAY_RIGHT((head)->sph_root, field);\ + SPLAY_LEFT(elm, field) = (head)->sph_root; \ + SPLAY_RIGHT((head)->sph_root, field) = NULL; \ + } else \ + return ((head)->sph_root); \ + } \ + (head)->sph_root = (elm); \ + return (NULL); \ +} \ + \ +struct type * \ +name##_SPLAY_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *__tmp; \ + if (SPLAY_EMPTY(head)) \ + return (NULL); \ + name##_SPLAY(head, elm); \ + if ((cmp)(elm, (head)->sph_root) == 0) { \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL) { \ + (head)->sph_root = SPLAY_RIGHT((head)->sph_root, field);\ + } else { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + (head)->sph_root = SPLAY_LEFT((head)->sph_root, field);\ + name##_SPLAY(head, elm); \ + SPLAY_RIGHT((head)->sph_root, field) = __tmp; \ + } \ + return (elm); \ + } \ + return (NULL); \ +} \ + \ +void \ +name##_SPLAY(struct name *head, struct type *elm) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ + int __comp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while ((__comp = (cmp)(elm, (head)->sph_root)) != 0) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if ((cmp)(elm, __tmp) > 0){ \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} \ + \ +/* Splay with either the minimum or the maximum element \ + * Used to find minimum or maximum element in tree. \ + */ \ +void name##_SPLAY_MINMAX(struct name *head, int __comp) \ +{ \ + struct type __node, *__left, *__right, *__tmp; \ +\ + SPLAY_LEFT(&__node, field) = SPLAY_RIGHT(&__node, field) = NULL;\ + __left = __right = &__node; \ +\ + while (1) { \ + if (__comp < 0) { \ + __tmp = SPLAY_LEFT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp < 0){ \ + SPLAY_ROTATE_RIGHT(head, __tmp, field); \ + if (SPLAY_LEFT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKLEFT(head, __right, field); \ + } else if (__comp > 0) { \ + __tmp = SPLAY_RIGHT((head)->sph_root, field); \ + if (__tmp == NULL) \ + break; \ + if (__comp > 0) { \ + SPLAY_ROTATE_LEFT(head, __tmp, field); \ + if (SPLAY_RIGHT((head)->sph_root, field) == NULL)\ + break; \ + } \ + SPLAY_LINKRIGHT(head, __left, field); \ + } \ + } \ + SPLAY_ASSEMBLE(head, &__node, __left, __right, field); \ +} + +#define SPLAY_NEGINF -1 +#define SPLAY_INF 1 + +#define SPLAY_INSERT(name, x, y) name##_SPLAY_INSERT(x, y) +#define SPLAY_REMOVE(name, x, y) name##_SPLAY_REMOVE(x, y) +#define SPLAY_FIND(name, x, y) name##_SPLAY_FIND(x, y) +#define SPLAY_NEXT(name, x, y) name##_SPLAY_NEXT(x, y) +#define SPLAY_MIN(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_NEGINF)) +#define SPLAY_MAX(name, x) (SPLAY_EMPTY(x) ? NULL \ + : name##_SPLAY_MIN_MAX(x, SPLAY_INF)) + +#define SPLAY_FOREACH(x, name, head) \ + for ((x) = SPLAY_MIN(name, head); \ + (x) != NULL; \ + (x) = SPLAY_NEXT(name, head, x)) + +/* Macros that define a red-black tree */ +#define RB_HEAD(name, type) \ +struct name { \ + struct type *rbh_root; /* root of the tree */ \ +} + +#define RB_INITIALIZER(root) \ + { NULL } + +#define RB_INIT(root) do { \ + (root)->rbh_root = NULL; \ +} while (/*CONSTCOND*/ 0) + +#define RB_BLACK 0 +#define RB_RED 1 +#define RB_ENTRY(type) \ +struct { \ + struct type *rbe_left; /* left element */ \ + struct type *rbe_right; /* right element */ \ + struct type *rbe_parent; /* parent element */ \ + int rbe_color; /* node color */ \ +} + +#define RB_LEFT(elm, field) (elm)->field.rbe_left +#define RB_RIGHT(elm, field) (elm)->field.rbe_right +#define RB_PARENT(elm, field) (elm)->field.rbe_parent +#define RB_COLOR(elm, field) (elm)->field.rbe_color +#define RB_ROOT(head) (head)->rbh_root +#define RB_EMPTY(head) (RB_ROOT(head) == NULL) + +#define RB_SET(elm, parent, field) do { \ + RB_PARENT(elm, field) = parent; \ + RB_LEFT(elm, field) = RB_RIGHT(elm, field) = NULL; \ + RB_COLOR(elm, field) = RB_RED; \ +} while (/*CONSTCOND*/ 0) + +#define RB_SET_BLACKRED(black, red, field) do { \ + RB_COLOR(black, field) = RB_BLACK; \ + RB_COLOR(red, field) = RB_RED; \ +} while (/*CONSTCOND*/ 0) + +#ifndef RB_AUGMENT +#define RB_AUGMENT(x) do {} while (/*CONSTCOND*/ 0) +#endif + +#define RB_ROTATE_LEFT(head, elm, tmp, field) do { \ + (tmp) = RB_RIGHT(elm, field); \ + if ((RB_RIGHT(elm, field) = RB_LEFT(tmp, field)) != NULL) { \ + RB_PARENT(RB_LEFT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_LEFT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +#define RB_ROTATE_RIGHT(head, elm, tmp, field) do { \ + (tmp) = RB_LEFT(elm, field); \ + if ((RB_LEFT(elm, field) = RB_RIGHT(tmp, field)) != NULL) { \ + RB_PARENT(RB_RIGHT(tmp, field), field) = (elm); \ + } \ + RB_AUGMENT(elm); \ + if ((RB_PARENT(tmp, field) = RB_PARENT(elm, field)) != NULL) { \ + if ((elm) == RB_LEFT(RB_PARENT(elm, field), field)) \ + RB_LEFT(RB_PARENT(elm, field), field) = (tmp); \ + else \ + RB_RIGHT(RB_PARENT(elm, field), field) = (tmp); \ + } else \ + (head)->rbh_root = (tmp); \ + RB_RIGHT(tmp, field) = (elm); \ + RB_PARENT(elm, field) = (tmp); \ + RB_AUGMENT(tmp); \ + if ((RB_PARENT(tmp, field))) \ + RB_AUGMENT(RB_PARENT(tmp, field)); \ +} while (/*CONSTCOND*/ 0) + +/* Generates prototypes and inline functions */ +#define RB_PROTOTYPE(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp,) +#define RB_PROTOTYPE_STATIC(name, type, field, cmp) \ + RB_PROTOTYPE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_PROTOTYPE_INTERNAL(name, type, field, cmp, attr) \ +attr void name##_RB_INSERT_COLOR(struct name *, struct type *); \ +attr void name##_RB_REMOVE_COLOR(struct name *, struct type *, struct type *);\ +attr struct type *name##_RB_REMOVE(struct name *, struct type *); \ +attr struct type *name##_RB_INSERT(struct name *, struct type *); \ +attr struct type *name##_RB_FIND(struct name *, struct type *); \ +attr struct type *name##_RB_NFIND(struct name *, struct type *); \ +attr struct type *name##_RB_NEXT(struct type *); \ +attr struct type *name##_RB_PREV(struct type *); \ +attr struct type *name##_RB_MINMAX(struct name *, int); \ + \ + +/* Main rb operation. + * Moves node close to the key of elm to top + */ +#define RB_GENERATE(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp,) +#define RB_GENERATE_STATIC(name, type, field, cmp) \ + RB_GENERATE_INTERNAL(name, type, field, cmp, __unused static) +#define RB_GENERATE_INTERNAL(name, type, field, cmp, attr) \ +attr void \ +name##_RB_INSERT_COLOR(struct name *head, struct type *elm) \ +{ \ + struct type *parent, *gparent, *tmp; \ + while ((parent = RB_PARENT(elm, field)) != NULL && \ + RB_COLOR(parent, field) == RB_RED) { \ + gparent = RB_PARENT(parent, field); \ + if (parent == RB_LEFT(gparent, field)) { \ + tmp = RB_RIGHT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_RIGHT(parent, field) == elm) { \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_RIGHT(head, gparent, tmp, field); \ + } else { \ + tmp = RB_LEFT(gparent, field); \ + if (tmp && RB_COLOR(tmp, field) == RB_RED) { \ + RB_COLOR(tmp, field) = RB_BLACK; \ + RB_SET_BLACKRED(parent, gparent, field);\ + elm = gparent; \ + continue; \ + } \ + if (RB_LEFT(parent, field) == elm) { \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = parent; \ + parent = elm; \ + elm = tmp; \ + } \ + RB_SET_BLACKRED(parent, gparent, field); \ + RB_ROTATE_LEFT(head, gparent, tmp, field); \ + } \ + } \ + RB_COLOR(head->rbh_root, field) = RB_BLACK; \ +} \ + \ +attr void \ +name##_RB_REMOVE_COLOR(struct name *head, struct type *parent, struct type *elm) \ +{ \ + struct type *tmp; \ + while ((elm == NULL || RB_COLOR(elm, field) == RB_BLACK) && \ + elm != RB_ROOT(head)) { \ + if (RB_LEFT(parent, field) == elm) { \ + tmp = RB_RIGHT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK) {\ + struct type *oleft; \ + if ((oleft = RB_LEFT(tmp, field)) \ + != NULL) \ + RB_COLOR(oleft, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_RIGHT(head, tmp, oleft, field);\ + tmp = RB_RIGHT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_RIGHT(tmp, field)) \ + RB_COLOR(RB_RIGHT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_LEFT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } else { \ + tmp = RB_LEFT(parent, field); \ + if (RB_COLOR(tmp, field) == RB_RED) { \ + RB_SET_BLACKRED(tmp, parent, field); \ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + if ((RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) &&\ + (RB_RIGHT(tmp, field) == NULL || \ + RB_COLOR(RB_RIGHT(tmp, field), field) == RB_BLACK)) {\ + RB_COLOR(tmp, field) = RB_RED; \ + elm = parent; \ + parent = RB_PARENT(elm, field); \ + } else { \ + if (RB_LEFT(tmp, field) == NULL || \ + RB_COLOR(RB_LEFT(tmp, field), field) == RB_BLACK) {\ + struct type *oright; \ + if ((oright = RB_RIGHT(tmp, field)) \ + != NULL) \ + RB_COLOR(oright, field) = RB_BLACK;\ + RB_COLOR(tmp, field) = RB_RED; \ + RB_ROTATE_LEFT(head, tmp, oright, field);\ + tmp = RB_LEFT(parent, field); \ + } \ + RB_COLOR(tmp, field) = RB_COLOR(parent, field);\ + RB_COLOR(parent, field) = RB_BLACK; \ + if (RB_LEFT(tmp, field)) \ + RB_COLOR(RB_LEFT(tmp, field), field) = RB_BLACK;\ + RB_ROTATE_RIGHT(head, parent, tmp, field);\ + elm = RB_ROOT(head); \ + break; \ + } \ + } \ + } \ + if (elm) \ + RB_COLOR(elm, field) = RB_BLACK; \ +} \ + \ +attr struct type * \ +name##_RB_REMOVE(struct name *head, struct type *elm) \ +{ \ + struct type *child, *parent, *old = elm; \ + int color; \ + if (RB_LEFT(elm, field) == NULL) \ + child = RB_RIGHT(elm, field); \ + else if (RB_RIGHT(elm, field) == NULL) \ + child = RB_LEFT(elm, field); \ + else { \ + struct type *left; \ + elm = RB_RIGHT(elm, field); \ + while ((left = RB_LEFT(elm, field)) != NULL) \ + elm = left; \ + child = RB_RIGHT(elm, field); \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ + if (RB_PARENT(elm, field) == old) \ + parent = elm; \ + (elm)->field = (old)->field; \ + if (RB_PARENT(old, field)) { \ + if (RB_LEFT(RB_PARENT(old, field), field) == old)\ + RB_LEFT(RB_PARENT(old, field), field) = elm;\ + else \ + RB_RIGHT(RB_PARENT(old, field), field) = elm;\ + RB_AUGMENT(RB_PARENT(old, field)); \ + } else \ + RB_ROOT(head) = elm; \ + RB_PARENT(RB_LEFT(old, field), field) = elm; \ + if (RB_RIGHT(old, field)) \ + RB_PARENT(RB_RIGHT(old, field), field) = elm; \ + if (parent) { \ + left = parent; \ + do { \ + RB_AUGMENT(left); \ + } while ((left = RB_PARENT(left, field)) != NULL); \ + } \ + goto color; \ + } \ + parent = RB_PARENT(elm, field); \ + color = RB_COLOR(elm, field); \ + if (child) \ + RB_PARENT(child, field) = parent; \ + if (parent) { \ + if (RB_LEFT(parent, field) == elm) \ + RB_LEFT(parent, field) = child; \ + else \ + RB_RIGHT(parent, field) = child; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = child; \ +color: \ + if (color == RB_BLACK) \ + name##_RB_REMOVE_COLOR(head, parent, child); \ + return (old); \ +} \ + \ +/* Inserts a node into the RB tree */ \ +attr struct type * \ +name##_RB_INSERT(struct name *head, struct type *elm) \ +{ \ + struct type *tmp; \ + struct type *parent = NULL; \ + int comp = 0; \ + tmp = RB_ROOT(head); \ + while (tmp) { \ + parent = tmp; \ + comp = (cmp)(elm, parent); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + RB_SET(elm, parent, field); \ + if (parent != NULL) { \ + if (comp < 0) \ + RB_LEFT(parent, field) = elm; \ + else \ + RB_RIGHT(parent, field) = elm; \ + RB_AUGMENT(parent); \ + } else \ + RB_ROOT(head) = elm; \ + name##_RB_INSERT_COLOR(head, elm); \ + return (NULL); \ +} \ + \ +/* Finds the node with the same key as elm */ \ +attr struct type * \ +name##_RB_FIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) \ + tmp = RB_LEFT(tmp, field); \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (NULL); \ +} \ + \ +/* Finds the first node greater than or equal to the search key */ \ +attr struct type * \ +name##_RB_NFIND(struct name *head, struct type *elm) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *res = NULL; \ + int comp; \ + while (tmp) { \ + comp = cmp(elm, tmp); \ + if (comp < 0) { \ + res = tmp; \ + tmp = RB_LEFT(tmp, field); \ + } \ + else if (comp > 0) \ + tmp = RB_RIGHT(tmp, field); \ + else \ + return (tmp); \ + } \ + return (res); \ +} \ + \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RB_NEXT(struct type *elm) \ +{ \ + if (RB_RIGHT(elm, field)) { \ + elm = RB_RIGHT(elm, field); \ + while (RB_LEFT(elm, field)) \ + elm = RB_LEFT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} \ + \ +/* ARGSUSED */ \ +attr struct type * \ +name##_RB_PREV(struct type *elm) \ +{ \ + if (RB_LEFT(elm, field)) { \ + elm = RB_LEFT(elm, field); \ + while (RB_RIGHT(elm, field)) \ + elm = RB_RIGHT(elm, field); \ + } else { \ + if (RB_PARENT(elm, field) && \ + (elm == RB_RIGHT(RB_PARENT(elm, field), field))) \ + elm = RB_PARENT(elm, field); \ + else { \ + while (RB_PARENT(elm, field) && \ + (elm == RB_LEFT(RB_PARENT(elm, field), field)))\ + elm = RB_PARENT(elm, field); \ + elm = RB_PARENT(elm, field); \ + } \ + } \ + return (elm); \ +} \ + \ +attr struct type * \ +name##_RB_MINMAX(struct name *head, int val) \ +{ \ + struct type *tmp = RB_ROOT(head); \ + struct type *parent = NULL; \ + while (tmp) { \ + parent = tmp; \ + if (val < 0) \ + tmp = RB_LEFT(tmp, field); \ + else \ + tmp = RB_RIGHT(tmp, field); \ + } \ + return (parent); \ +} + +#define RB_NEGINF -1 +#define RB_INF 1 + +#define RB_INSERT(name, x, y) name##_RB_INSERT(x, y) +#define RB_REMOVE(name, x, y) name##_RB_REMOVE(x, y) +#define RB_FIND(name, x, y) name##_RB_FIND(x, y) +#define RB_NFIND(name, x, y) name##_RB_NFIND(x, y) +#define RB_NEXT(name, x, y) name##_RB_NEXT(y) +#define RB_PREV(name, x, y) name##_RB_PREV(y) +#define RB_MIN(name, x) name##_RB_MINMAX(x, RB_NEGINF) +#define RB_MAX(name, x) name##_RB_MINMAX(x, RB_INF) + +#define RB_FOREACH(x, name, head) \ + for ((x) = RB_MIN(name, head); \ + (x) != NULL; \ + (x) = name##_RB_NEXT(x)) + +#define RB_FOREACH_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_SAFE(x, name, head, y) \ + for ((x) = RB_MIN(name, head); \ + ((x) != NULL) && ((y) = name##_RB_NEXT(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE(x, name, head) \ + for ((x) = RB_MAX(name, head); \ + (x) != NULL; \ + (x) = name##_RB_PREV(x)) + +#define RB_FOREACH_REVERSE_FROM(x, name, y) \ + for ((x) = (y); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + +#define RB_FOREACH_REVERSE_SAFE(x, name, head, y) \ + for ((x) = RB_MAX(name, head); \ + ((x) != NULL) && ((y) = name##_RB_PREV(x), (x) != NULL); \ + (x) = (y)) + +#endif /* _SYS_TREE_H_ */ diff --git a/repo/neon/neon.xibuild b/repo/neon/neon.xibuild new file mode 100644 index 0000000..1e2d362 --- /dev/null +++ b/repo/neon/neon.xibuild @@ -0,0 +1,33 @@ +#!/bin/sh + +NAME="neon" +DESC="HTTP and WebDAV client library with a C interface" + +MAKEDEPS="expat openssl zlib gzip xmlto autoconf automake libtool" + +PKG_VER=0.32.2 +SOURCE="https://github.com/notroj/neon/archive/$PKG_VER.tar.gz" + +prepare() { + ./autogen.sh +} + +build() { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --with-ssl \ + --with-expat \ + --without-gssapi \ + --disable-nls \ + --enable-shared \ + --disable-static \ + --enable-threadsafe-ssl=posix \ + --with-ca-bundle=/etc/ssl/certs/ca-certificates.crt + make && make docs +} + +package() { + make -j1 DESTDIR="$PKG_DEST" install +} diff --git a/repo/nheko/nheko.xibuild b/repo/nheko/nheko.xibuild new file mode 100644 index 0000000..63396fe --- /dev/null +++ b/repo/nheko/nheko.xibuild @@ -0,0 +1,40 @@ +#!/bin/sh + +NAME="nheko" +DESC="Qt5-based client for Matrix protocol" + +MAKEDEPS=" asciidoctor cmake ninja boost lmdb lmdbxx tweeny qt5-qtbase qt5-qttools qt5-qtmultimedia qt5-qtsvg qt5-qtdeclarative qt5-qtquickcontrols2 qt5-qtkeychain zlib openssl olm nlohmann-json cmark spdlog mtxclient gst-plugins-base gst-plugins-bad xcb-util-wm gstreamer libevent fmt coeurl" +DEPS="qt5-qtgraphicaleffects qt5-qtbase qt5-qtmultimedia qt5-qtkeychain qt5-qtsvg" + +PKG_VER=0.9.3 +SOURCE="https://github.com/Nheko-Reborn/nheko/archive/v$PKG_VER.tar.gz" + +ADDITIONAL="remove-fatal-secrets-error.patch" + +prepare() { + apply_patches + + sed -e '/-Wall/d' \ + -e '/-Wextra/d' \ + -e '/-Werror/d' \ + -e '/-pedantic/d' \ + -e '/-pipe/d' \ + -i CMakeLists.txt +} + +build() { + cmake -B build \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_SKIP_RPATH=True \ + -DCMAKE_BUILD_TYPE=None \ + . + ninja -C build +} + +package() { + DESTDIR="$PKG_DEST" ninja -C build install +} + diff --git a/repo/nheko/remove-fatal-secrets-error.patch b/repo/nheko/remove-fatal-secrets-error.patch new file mode 100644 index 0000000..3db84bd --- /dev/null +++ b/repo/nheko/remove-fatal-secrets-error.patch @@ -0,0 +1,43 @@ +--- a/src/Cache.cpp 2022-06-05 16:42:28.397722089 +0100 ++++ b/src/Cache.cpp 2022-06-05 16:41:12.208727406 +0100 +@@ -328,24 +328,6 @@ + }); + } + +-static void +-fatalSecretError() +-{ +- QMessageBox::critical( +- nullptr, +- QCoreApplication::translate("SecretStorage", "Failed to connect to secret storage"), +- QCoreApplication::translate( +- "SecretStorage", +- "Nheko could not connect to the secure storage to save encryption secrets to. This can " +- "have multiple reasons. Check if your D-Bus service is running and you have configured a " +- "service like KWallet, Gnome Keyring, KeePassXC or the equivalent for your platform. If " +- "you are having trouble, feel free to open an issue here: " +- "https://github.com/Nheko-Reborn/nheko/issues")); +- +- QCoreApplication::exit(1); +- exit(1); +-} +- + static QString + secretName(std::string name, bool internal) + { +@@ -406,7 +388,6 @@ + job->error(), + job->errorString().toStdString()); + +- fatalSecretError(); + } + if (secret.isEmpty()) { + nhlog::db()->debug("Restored empty secret '{}'.", name.toStdString()); +@@ -472,7 +453,6 @@ + if (job->error()) { + nhlog::db()->warn( + "Storing secret '{}' failed: {}", name_, job->errorString().toStdString()); +- fatalSecretError(); + } else { + // if we emit the signal directly, qtkeychain breaks and won't execute new + // jobs. You can't start a job from the finish signal of a job. diff --git a/repo/nlohmann-json/nlohmann-json.xibuild b/repo/nlohmann-json/nlohmann-json.xibuild new file mode 100644 index 0000000..81dcba0 --- /dev/null +++ b/repo/nlohmann-json/nlohmann-json.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +NAME="nlohmann-json" +DESC="JSON for Modern C++" + +MAKEDEPS=" cmake" + +PKG_VER=3.10.5 +SOURCE="https://github.com/nlohmann/json/archive/v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DJSON_MultipleHeaders=ON + cmake --build build + + make -C doc +} + +check() { + cd build + CTEST_OUTPUT_ON_FAILURE=TRUE ctest -E "cmake_fetch_content_(configure|build)" + cd $BUILD_ROOT +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build + + install -dm755 "$PKG_DEST"/usr/share/doc/nlohmann-json + mv doc/mkdocs "$PKG_DEST"/usr/share/doc/nlohmann-json/ +} + diff --git a/repo/olm/olm.xibuild b/repo/olm/olm.xibuild new file mode 100644 index 0000000..60a4169 --- /dev/null +++ b/repo/olm/olm.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME="olm" +DESC="Implementation of the olm and megolm cryptographic ratchets" + +MAKEDEPS="cmake python python-cffi" + +PKG_VER=3.2.10 +SOURCE="https://gitlab.matrix.org/matrix-org/olm/-/archive/$PKG_VER/olm-$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib + cmake --build build + + cd python + python3 setup.py build +} + +package() { + cd .. + DESTDIR="$PKG_DEST" cmake --install build +} diff --git a/repo/oniguruma/oniguruma.xibuild b/repo/oniguruma/oniguruma.xibuild new file mode 100644 index 0000000..9cea3d0 --- /dev/null +++ b/repo/oniguruma/oniguruma.xibuild @@ -0,0 +1,33 @@ +#!/bin/sh + +NAME="oniguruma" +DESC="a regular expressions library" + +MAKEDEPS=" automake autoconf libtool" + +PKG_VER=6.9.7.1 +SOURCE="https://github.com/kkos/oniguruma/archive/v$PKG_VER.tar.gz" + +prepare() { + autoreconf -vfi +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --enable-posix-api + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/openexr/fix-x86.patch b/repo/openexr/fix-x86.patch new file mode 100644 index 0000000..49b62a5 --- /dev/null +++ b/repo/openexr/fix-x86.patch @@ -0,0 +1,33 @@ +From 0293978345d9b9188da36e48aa5fa419f81a57ac Mon Sep 17 00:00:00 2001 +From: Leon Marz <main@lmarz.org> +Date: Mon, 18 Apr 2022 10:35:52 +0200 +Subject: [PATCH] fix x86 + +--- + src/lib/Iex/IexMathFpu.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/lib/Iex/IexMathFpu.cpp b/src/lib/Iex/IexMathFpu.cpp +index b73e98f..2482c36 100644 +--- a/src/lib/Iex/IexMathFpu.cpp ++++ b/src/lib/Iex/IexMathFpu.cpp +@@ -251,14 +251,14 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions) + inline void + restoreControlRegs (const ucontext_t & ucon, bool clearExceptions) + { +-# if defined(__GLIBC__) && defined(__i386__) ++# if defined(__i386__) + setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal); + #else + setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal); + # endif + + _fpstate* kfp = reinterpret_cast<_fpstate*> (ucon.uc_mcontext.fpregs); +-# if defined(__GLIBC__) && defined(__i386__) ++# if defined(__i386__) + setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions); + #else + setMxcsr (kfp->mxcsr, clearExceptions); +-- +2.35.2 + diff --git a/repo/openexr/openexr.xibuild b/repo/openexr/openexr.xibuild new file mode 100644 index 0000000..94647c1 --- /dev/null +++ b/repo/openexr/openexr.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="openexr" +DESC="A high dynamic-range image file format library" + +MAKEDEPS="boost chrpath cmake ninja zlib" + +PKG_VER=3.1.5 +SOURCE="https://github.com/openexr/openexr/archive/v$PKG_VER.tar.gz" + +ADDITIONAL=" +fix-x86.patch +" + +build() { + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + $CMAKE_CROSSOPTS + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/openpgm/libpgm-fix-pkgconfig.patch b/repo/openpgm/libpgm-fix-pkgconfig.patch new file mode 100644 index 0000000..64272f4 --- /dev/null +++ b/repo/openpgm/libpgm-fix-pkgconfig.patch @@ -0,0 +1,21 @@ +From ee25ff3d13f2639b4c3a42125e79f77f921c3320 Mon Sep 17 00:00:00 2001 +From: Luca Boccassi <bluca@debian.org> +Date: Wed, 23 Jan 2019 10:37:37 +0000 +Subject: [PATCH] pkg-config: do not add -I to non-existing directory + +foo/lib/pgm-5.2/include does not exist, so applications using strict +compiler flags will fail to build due to this -I flag +--- + openpgm/pgm/openpgm-5.2.pc.in | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/openpgm/pgm/openpgm-5.2.pc.in b/openpgm/pgm/openpgm-5.2.pc.in +index 1e56d944..9e30a6da 100644 +--- a/openpgm-5.2.pc.in ++++ b/openpgm-5.2.pc.in +@@ -9,4 +9,4 @@ Version: @PACKAGE_VERSION@ + # packagers may wish to move @LIBS@ to Libs.private for platforms with + # versions of pkg-config that support static linking. + Libs: -L${libdir} -lpgm @LIBS@ +-Cflags: -I${includedir}/pgm-@VERSION_MAJOR@.@VERSION_MINOR@ -I${libdir}/pgm-@VERSION_MAJOR@.@VERSION_MINOR@/include ++Cflags: -I${includedir}/pgm-@VERSION_MAJOR@.@VERSION_MINOR@ diff --git a/repo/openpgm/openpgm-fix-includes.patch b/repo/openpgm/openpgm-fix-includes.patch new file mode 100644 index 0000000..6f1e590 --- /dev/null +++ b/repo/openpgm/openpgm-fix-includes.patch @@ -0,0 +1,30 @@ +--- ./include/pgm/types.h ++++ ./include/pgm/types.h +@@ -27,6 +27,7 @@ + + #ifndef _MSC_VER + # include <sys/param.h> ++# include <sys/types.h> + #endif + #include <pgm/macros.h> + +--- ./include/impl/security.h ++++ ./include/impl/security.h +@@ -33,7 +33,6 @@ + #include <stdio.h> + #include <stdarg.h> + #include <sys/types.h> +-#include <sys/timeb.h> + #include <impl/i18n.h> + #include <impl/errno.h> + #include <impl/string.h> +@@ -41,6 +40,8 @@ + PGM_BEGIN_DECLS + + #ifdef HAVE_FTIME ++#include <sys/timeb.h> ++ + static inline + errno_t + # if !defined( _WIN32 ) + diff --git a/repo/openpgm/openpgm.xibuild b/repo/openpgm/openpgm.xibuild new file mode 100644 index 0000000..e38ac42 --- /dev/null +++ b/repo/openpgm/openpgm.xibuild @@ -0,0 +1,37 @@ +#!/bin/sh + +NAME="openpgm" +DESC="An implementation of the PGM reliable multicast protocol" + +MAKEDEPS="python perl" + +PKG_VER=5.2.122 +SOURCE="https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/openpgm/libpgm-$PKG_VER.tar.bz2" + +ADDITIONAL=" +libpgm-fix-pkgconfig.patch +openpgm-fix-includes.patch +python3.patch +" + +prepare() { + cd openpgm/pgm + for p in $BUILD_ROOT/*.patch; do + patch -Np1 -i $p + done +} + +build() { + CFLAGS="$CFLAGS -D_GNU_SOURCE" \ + ./configure \ + --prefix=/usr \ + --enable-shared \ + --disable-static \ + PYTHON=python3 + make +} + +package() { + make install DESTDIR="$PKG_DEST" +} + diff --git a/repo/openpgm/python3.patch b/repo/openpgm/python3.patch new file mode 100644 index 0000000..f1ae797 --- /dev/null +++ b/repo/openpgm/python3.patch @@ -0,0 +1,28 @@ +diff --git a/version_generator.py b/version_generator.py +index b2f8f9a..0143d67 100755 +--- a/version_generator.py ++++ b/version_generator.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python ++#!/usr/bin/python3 + + import os + import platform +@@ -8,7 +8,7 @@ build_date = time.strftime ("%Y-%m-%d") + build_time = time.strftime ("%H:%M:%S") + build_rev = filter (str.isdigit, "$Revision: 1487 $") + +-print """ ++print(""" + /* vim:ts=8:sts=8:sw=4:noai:noexpandtab + * + * OpenPGM version. +@@ -50,6 +50,6 @@ const char* pgm_build_revision = "%s"; + + + /* eof */ +-"""%(build_date, build_time, platform.system(), platform.machine(), build_rev) ++"""%(build_date, build_time, platform.system(), platform.machine(), build_rev)) + + # end of file + diff --git a/repo/orc/orc-compiler.xibuild b/repo/orc/orc-compiler.xibuild new file mode 100644 index 0000000..2278b35 --- /dev/null +++ b/repo/orc/orc-compiler.xibuild @@ -0,0 +1,7 @@ +#!/bin/sh + +DESC="Orc compiler" + +package () { + add_from_main usr/bin +} diff --git a/repo/orc/orc.xibuild b/repo/orc/orc.xibuild new file mode 100644 index 0000000..1e23e44 --- /dev/null +++ b/repo/orc/orc.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +NAME="orc" +DESC="The Oil Run-time Compiler" + +MAKEDEPS="linux-headers meson" + +PKG_VER=0.4.32 +SOURCE="https://gstreamer.freedesktop.org/src/orc/orc-$PKG_VER.tar.xz" + +build() { + meson --prefix=/usr \ + -Dorc-test=disabled \ + . output + meson compile ${JOBS:+-j ${JOBS}} -C output +} + +check() { + meson test --no-rebuild -v -C output +} + +package() { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C output +} + + diff --git a/repo/perl-file-rename/perl-file-rename.xibuild b/repo/perl-file-rename/perl-file-rename.xibuild new file mode 100644 index 0000000..561e4d6 --- /dev/null +++ b/repo/perl-file-rename/perl-file-rename.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="perl-file-rename" +DESC="Perl extension for renaming multiple files" + +MAKEDEPS=" perl-module-build" + +PKG_VER=1.30 +SOURCE="https://cpan.metacpan.org/authors/id/R/RM/RMBARKER/File-Rename-$PKG_VER.tar.gz" + +build() { + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + perl Build.PL --installdirs=vendor + ./Build +} + +check() { + ./Build test +} + +package() { + ./Build install --destdir="$PKG_DEST" + find "$PKG_DEST" \( -name perllocal.pod -o -name .packlist \) -delete + mv $PKG_DEST/usr/bin/rename $PKG_DEST/usr/bin/perl-rename + chmod 0755 $PKG_DEST/usr/bin/perl-rename +} + diff --git a/repo/perl-module-build/perl-module-build.xibuild b/repo/perl-module-build/perl-module-build.xibuild new file mode 100644 index 0000000..8c88836 --- /dev/null +++ b/repo/perl-module-build/perl-module-build.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +NAME="perl-module-build" +DESC="Build and install Perl modules" + +MAKEDEPS=" perl" + +PKG_VER=0.4231 +SOURCE="https://cpan.metacpan.org/authors/id/L/LE/LEONT/Module-Build-$PKG_VER.tar.gz" + +prepare() { + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + perl Build.PL installdirs=vendor +} + +build() { + export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') + ./Build +} + +check() { + ./Build test +} + + +package() { + ./Build install destdir="$PKG_DEST" + find "$PKG_DEST" \( -name perllocal.pod -o -name .packlist \) -delete +} + diff --git a/repo/python-build/python-build.xibuild b/repo/python-build/python-build.xibuild new file mode 100644 index 0000000..d645b71 --- /dev/null +++ b/repo/python-build/python-build.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="python" +DEPS="python python-pep517 python-pyparsing" + +PKG_VER=0.7.0 +SOURCE="https://files.pythonhosted.org/packages/source/b/build/build-$PKG_VER.tar.gz" +DESC="Correct PEP517 package builder" + +build() { + python setup.py build +} + +package () { + python setup.py install --root="$PKG_DEST" --optimize=1 +} diff --git a/repo/python-cffi/musl-compat.patch b/repo/python-cffi/musl-compat.patch new file mode 100644 index 0000000..1145250 --- /dev/null +++ b/repo/python-cffi/musl-compat.patch @@ -0,0 +1,65 @@ +--- a/c/test_c.py ++++ b/c/test_c.py +@@ -86,7 +86,6 @@ + if sys.platform.startswith("linux"): + RTLD_NODELETE + RTLD_NOLOAD +- RTLD_DEEPBIND + + def test_new_primitive_type(): + py.test.raises(KeyError, new_primitive_type, "foo") +@@ -1237,8 +1236,7 @@ + def test_write_variable(): + ## FIXME: this test assumes glibc specific behavior, it's not compliant with C standard + ## https://bugs.pypy.org/issue1643 +- if not sys.platform.startswith("linux"): +- py.test.skip("untested") ++ py.test.skip("'stderr' is read-only in musl") + BVoidP = new_pointer_type(new_void_type()) + ll = find_and_load_library('c') + stderr = ll.read_variable(BVoidP, "stderr") +--- a/testing/cffi0/test_function.py ++++ b/testing/cffi0/test_function.py +@@ -166,7 +166,7 @@ + b"hello, world!\n" + b"hello, world2!\n" + b"hello int 42 long 84 long long 168\n" +- b"hello (nil)\n") ++ b"hello 0\n") + + def test_must_specify_type_of_vararg(self): + ffi = FFI(backend=self.Backend()) +@@ -249,8 +249,7 @@ + assert res == 5 + + def test_write_variable(self): +- if not sys.platform.startswith('linux'): +- py.test.skip("probably no symbol 'stdout' in the lib") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI(backend=self.Backend()) + ffi.cdef(""" + void *stdout; +--- a/testing/cffi0/test_verify.py ++++ b/testing/cffi0/test_verify.py +@@ -1612,8 +1612,7 @@ + assert func() == 42 + + def test_FILE_stored_in_stdout(): +- if not sys.platform.startswith('linux'): +- py.test.skip("likely, we cannot assign to stdout") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI() + ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") + lib = ffi.verify(""" +--- a/testing/cffi1/test_verify1.py ++++ b/testing/cffi1/test_verify1.py +@@ -1576,8 +1576,7 @@ + assert func() == 42 + + def test_FILE_stored_in_stdout(): +- if not sys.platform.startswith('linux'): +- py.test.skip("likely, we cannot assign to stdout") ++ py.test.skip("'stdout' is read-only in musl") + ffi = FFI() + ffi.cdef("int printf(const char *, ...); FILE *setstdout(FILE *);") + lib = ffi.verify(""" diff --git a/repo/python-cffi/python-cffi.xibuild b/repo/python-cffi/python-cffi.xibuild new file mode 100644 index 0000000..ca5c1c4 --- /dev/null +++ b/repo/python-cffi/python-cffi.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="python-cffi" +DESC="Foreign function interface for calling C code from Python3" + +MAKEDEPS="python libffi" + +PKG_VER=1.15.0 +SOURCE="https://files.pythonhosted.org/packages/source/c/cffi/cffi-$PKG_VER.tar.gz" + +ADDITIONAL=" +musl-compat.patch +" + +prepare () { + apply_patches +} + +build() { + python3 setup.py build +} + +check() { + python3 setup.py build_ext -i + python3 -m pytest --disable-pytest-warnings c/ testing/ || true +} + +package() { + python3 setup.py install --prefix=/usr --root="$PKG_DEST" +} + diff --git a/repo/python-installer/python-installer.xibuild b/repo/python-installer/python-installer.xibuild new file mode 100644 index 0000000..232faf8 --- /dev/null +++ b/repo/python-installer/python-installer.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +NAME="python-installer" +DESC="low-level library for installing from a Python wheel distribution" + +MAKEDEPS="python" + +PKG_VER=0.5.1 +SOURCE="https://files.pythonhosted.org/packages/source/i/installer/installer-$PKG_VER.tar.gz" + +build () { + python3 setup.py build +} + +package() { + python3 setup.py install --prefix=/usr --root="$PKG_DEST" +} diff --git a/repo/python-jsonschema.xibuild b/repo/python-jsonschema.xibuild new file mode 100644 index 0000000..4c33edd --- /dev/null +++ b/repo/python-jsonschema.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="python" +DEPS="%deps%" + +PKG_VER= +SOURCE= +DESC="" + +build() { + python setup.py build +} + +package () { + python setup.py install --root="$PKG_DEST" --optimize=1 +} diff --git a/repo/python-jsonschema/python-jsonschema.xibuild b/repo/python-jsonschema/python-jsonschema.xibuild new file mode 100644 index 0000000..eb76f69 --- /dev/null +++ b/repo/python-jsonschema/python-jsonschema.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +NAME="python-jsonschema" +DESC="An implementation of JSON Schema validation for Python" + +MAKEDEPS="python python-build python-tomli python-setuptools-scm python-wheel" + +PKG_VER=4.4.0 +SOURCE="https://files.pythonhosted.org/packages/source/j/jsonschema/jsonschema-$PKG_VER.tar.gz" + +build() { + python3 -m build --no-isolation --wheel +} + +package() { + python3 -m installer -d "$PKG_DEST" \ + dist/jsonschema-$PKG_VER-py3-none-any.whl + + # Add version suffix to executable files. + local path; for path in "$PKG_DEST"/usr/bin/*; do + mv "$path" "$path"-3 + done + + ln -s jsonschema-3 "$PKG_DEST"/usr/bin/jsonschema +} + diff --git a/repo/python-pep517/python-pep517.xibuild b/repo/python-pep517/python-pep517.xibuild new file mode 100644 index 0000000..f82ad58 --- /dev/null +++ b/repo/python-pep517/python-pep517.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="python" +DEPS="python python-tomli" + +PKG_VER=0.12.0 +SOURCE="https://files.pythonhosted.org/packages/source/p/pep517/pep517-$PKG_VER.tar.gz" +DESC="Correct PEP517 package builder" + +build() { + python setup.py build +} + +package () { + python setup.py install --root="$PKG_DEST" --optimize=1 +} diff --git a/repo/python-setuptools-scm/deprecation-warning.patch b/repo/python-setuptools-scm/deprecation-warning.patch new file mode 100644 index 0000000..cf7a2c3 --- /dev/null +++ b/repo/python-setuptools-scm/deprecation-warning.patch @@ -0,0 +1,10 @@ +--- ./tox.ini ++++ ./tox.ini +@@ -6,6 +6,7 @@ + filterwarnings= + error + ignore:.*tool\.setuptools_scm.* ++ ignore:Creating a LegacyVersion has been deprecated and will be removed in the next major release:DeprecationWarning + markers= + issue(id): reference to github issue + skip_commit: allows to skip commiting in the helpers diff --git a/repo/python-setuptools-scm/python-setuptools-scm.xibuild b/repo/python-setuptools-scm/python-setuptools-scm.xibuild new file mode 100644 index 0000000..e81ca07 --- /dev/null +++ b/repo/python-setuptools-scm/python-setuptools-scm.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="python-setuptools-scm" +DESC="The blessed package to manage your versions by scm tags" + +MAKEDEPS="python-packaging python-tomli" +DEPS="python-packaging python-tomli " + +PKG_VER=6.4.2 +SOURCE="https://files.pythonhosted.org/packages/source/s/setuptools_scm/setuptools_scm-$PKG_VER.tar.gz" +ADDITIONAL="test_integration.patch deprecation-warning.patch " + +prepare () { + apply_patches +} + +build() { + python setup.py build +} + +package () { + python setup.py install --root="$PKG_DEST" --optimize=1 +} diff --git a/repo/python-setuptools-scm/test_integration.patch b/repo/python-setuptools-scm/test_integration.patch new file mode 100644 index 0000000..09490b5 --- /dev/null +++ b/repo/python-setuptools-scm/test_integration.patch @@ -0,0 +1,11 @@ +--- ./testing/test_integration.py ++++ ./testing/test_integration.py +@@ -119,7 +119,7 @@ + monkeypatch.setenv(PRETEND_KEY, "dummy") + wd.write("setup.py", SETUP_PY_PLAIN) + assert wd.get_version(write_to="test.py") == "dummy" +- assert wd("python setup.py --version") == "0.0.0" ++ assert wd("python3 setup.py --version") == "0.0.0" + + + def test_own_setup_fails_on_old_python(monkeypatch): diff --git a/repo/python-tomli/python-tomli.xibuild b/repo/python-tomli/python-tomli.xibuild new file mode 100644 index 0000000..7d2a8aa --- /dev/null +++ b/repo/python-tomli/python-tomli.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +NAME="python-tomli" +DESC="Lil' TOML parser" + +MAKEDEPS="python-installer" + +PKG_VER=2.0.1 +SOURCE="https://files.pythonhosted.org/packages/source/t/tomli/tomli-$PKG_VER.tar.gz" +ADDITIONAL="https://files.pythonhosted.org/packages/py3/t/tomli/tomli-$PKG_VER-py3-none-any.whl" + +build() { + return 0 +} + +package() { + python3 -m installer -d "$PKG_DEST" "$BUILD_ROOT"/tomli-$PKG_VER-py3-none-any.whl +} diff --git a/repo/python-wheel/python-wheel.xibuild b/repo/python-wheel/python-wheel.xibuild new file mode 100644 index 0000000..02b36a8 --- /dev/null +++ b/repo/python-wheel/python-wheel.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME="python-wheel" +DESC="built-package format for Python" + +MAKEDEPS="python " +DEPS="python-packaging " + +PKG_VER=0.37.1 +SOURCE="https://files.pythonhosted.org/packages/source/w/wheel/wheel-$PKG_VER.tar.gz" +ADDITIONAL="use-system-packaging.patch " + +prepare () { + apply_patches +} + +build() { + rm -rf src/wheel/vendored + + python3 setup.py build +} + +package() { + python3 setup.py install --prefix=/usr --root="$PKG_DEST" +} diff --git a/repo/python-wheel/use-system-packaging.patch b/repo/python-wheel/use-system-packaging.patch new file mode 100644 index 0000000..8944566 --- /dev/null +++ b/repo/python-wheel/use-system-packaging.patch @@ -0,0 +1,21 @@ +Upstream vendors packaging, use system packaging instead + +diff --git a/src/wheel/bdist_wheel.py b/src/wheel/bdist_wheel.py +index 80e43d0..6bb272c 100644 +--- a/src/wheel/bdist_wheel.py ++++ b/src/wheel/bdist_wheel.py +@@ -19,13 +19,13 @@ from glob import iglob + from shutil import rmtree + from sysconfig import get_config_var + from zipfile import ZIP_DEFLATED, ZIP_STORED ++from packaging import tags + + import pkg_resources + + from .pkginfo import write_pkg_info + from .macosx_libfile import calculate_macosx_platform_tag + from .metadata import pkginfo_to_metadata +-from .vendored.packaging import tags + from .wheelfile import WheelFile + from . import __version__ as wheel_version + diff --git a/repo/qt5-qtdeclarative/link-libatomic-on-rv64.patch b/repo/qt5-qtdeclarative/link-libatomic-on-rv64.patch new file mode 100644 index 0000000..8530522 --- /dev/null +++ b/repo/qt5-qtdeclarative/link-libatomic-on-rv64.patch @@ -0,0 +1,11 @@ +--- ./src/qml/qml.pro.orig ++++ ./src/qml/qml.pro +@@ -12,6 +12,8 @@ + + DEFINES += QT_NO_URL_CAST_FROM_STRING QT_NO_INTEGER_EVENT_COORDINATES + ++unix:LIBS += -latomic ++ + msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x66000000 + msvc:DEFINES *= _CRT_SECURE_NO_WARNINGS + win32:!winrt:LIBS += -lshell32 diff --git a/repo/qt5-qtdeclarative/qt-musl-stackbottom.patch b/repo/qt5-qtdeclarative/qt-musl-stackbottom.patch new file mode 100644 index 0000000..fdfc192 --- /dev/null +++ b/repo/qt5-qtdeclarative/qt-musl-stackbottom.patch @@ -0,0 +1,17 @@ +For musl libc the stackBottom for the main thread is recalculated +just as it is for Android. See: https://bugreports.qt.io/browse/QTBUG-44268 + +--- qtdeclarative/src/qml/jsruntime/qv4engine.cpp 2016-02-26 10:34:34.000000000 +0100 ++++ qtdeclarative/src/qml/jsruntime/qv4engine.cpp 2016-04-04 21:52:43.780823136 +0200 +@@ -94,6 +94,11 @@ + #include <valgrind/memcheck.h> + #endif + ++#if defined(Q_OS_LINUX) && !defined(__GLIBC__) ++#include <sys/syscall.h> ++#define gettid() syscall(SYS_gettid) ++#endif ++ + QT_BEGIN_NAMESPACE + + using namespace QV4; diff --git a/repo/qt5-qtdeclarative/qt5-qtdeclarative.xibuild b/repo/qt5-qtdeclarative/qt5-qtdeclarative.xibuild new file mode 100644 index 0000000..135f6c3 --- /dev/null +++ b/repo/qt5-qtdeclarative/qt5-qtdeclarative.xibuild @@ -0,0 +1,51 @@ +#!/bin/sh + +NAME="qt5-qtdeclarative" +DESC="Qt5 - QtDeclarative component" + +MAKEDEPS=" python qt5-qtbase " + +PKG_VER=5.15.3_git20220209 +_commit="29ee9a0e9f02ec74153a2cf09dc63722bc273544" +SOURCE="https://invent.kde.org/qt/qt/qtdeclarative/-/archive/$_commit/qtdeclarative-$_commit.tar.gz" + +ADDITIONAL=" +link-libatomic-on-rv64.patch +qt-musl-stackbottom.patch +" + +prepare() { + apply_patches + mkdir .git + + export CFLAGS="$CFLAGS -O2" + export CPPFLAGS="$CPPFLAGS -O2" + export CXXFLAGS="$CXXFLAGS -O2" +} + + +build() { + # HACK so calls to "python" get what we want + ln -s /usr/bin/python3 python + export PATH="$(pwd):$PATH" + + qmake-qt5 + make +} + +check() { + make check +} + +package() { + make install INSTALL_ROOT="$PKG_DEST" + + mkdir -p "$PKG_DEST"/usr/bin/ + for i in "$PKG_DEST"/"$_qt5_prefix"/bin/*; do + ln -s ../lib/qt5/bin/${i##*/} "$PKG_DEST"/usr/bin/${i##*/}-qt5 + done + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$PKG_DEST/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; +} diff --git a/repo/qt5-qtgraphicaleffects/qt5-qtgraphicaleffects.xibuild b/repo/qt5-qtgraphicaleffects/qt5-qtgraphicaleffects.xibuild new file mode 100644 index 0000000..8fc7036 --- /dev/null +++ b/repo/qt5-qtgraphicaleffects/qt5-qtgraphicaleffects.xibuild @@ -0,0 +1,35 @@ +#!/bin/sh + +NAME="qt5-qtgraphicaleffects" +DESC="Qt5 - QtGraphicalEffects component" + +MAKEDEPS=" qt5-qtbase qt5-qtdeclarative" + +PKG_VER=5.15.3_git20201105 +_commit="c36998dc1581167b12cc3de8e4ac68c2a5d9f76e" +SOURCE="https://invent.kde.org/qt/qt/qtgraphicaleffects/-/archive/$_commit/qtgraphicaleffects-$_commit.tar.gz" + +prepare() { + mkdir .git +} + +build() { + qmake-qt5 + make +} + +check() { + make check +} + +package() { + make install INSTALL_ROOT="$PKG_DEST" + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$PKG_DEST/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; + + install -d "$PKG_DEST"/usr/share/licenses + ln -s /usr/share/licenses/qt5-base "$PKG_DEST"/usr/share/licenses/qt5-qtgraphicaleffects +} + diff --git a/repo/qt5-qtkeychain/qt5-qtkeychain.xibuild b/repo/qt5-qtkeychain/qt5-qtkeychain.xibuild new file mode 100644 index 0000000..dca8770 --- /dev/null +++ b/repo/qt5-qtkeychain/qt5-qtkeychain.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +NAME="qt5-qtkeychain" +DESC="Qt API to store passwords and other secret data" + +MAKEDEPS="cmake qt5-qttools libsecret ninja" + +PKG_VER=0.13.2 +SOURCE="https://github.com/frankosterfeld/qtkeychain/archive/v$PKG_VER.tar.gz" + +build() { + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DBUILD_SHARED_LIBS=True \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_C_FLAGS="$CFLAGS" + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/qt5-qtmultimedia/qt5-qtmultimedia.xibuild b/repo/qt5-qtmultimedia/qt5-qtmultimedia.xibuild new file mode 100644 index 0000000..40469f1 --- /dev/null +++ b/repo/qt5-qtmultimedia/qt5-qtmultimedia.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +NAME="qt5-qtmultimedia" +DESC="Qt5 - Multimedia support" + +MAKEDEPS="alsa-lib gst-plugins-base libxv qt5-qtbase qt5-qtdeclarative" + +PKG_VER=5.15.3_git20201130 +_commit="bd29c87027637a013f2c5e3b549fcda84e4d7545" +SOURCE="https://invent.kde.org/qt/qt/qtmultimedia/-/archive/$_commit/qtmultimedia-$_commit.tar.gz" + +prepare() { + mkdir .git +} + +build() { + qmake-qt5 + make +} + +check() { + make check +} +package() { + make INSTALL_ROOT="$PKG_DEST" install + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$PKG_DEST/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; + + install -d "$PKG_DEST"/usr/share/licenses + ln -s /usr/share/licenses/qt5-base "$PKG_DEST"/usr/share/licenses/qt5-qtmultimedia +} + diff --git a/repo/qt5-qtquickcontrols2/qt5-qtquickcontrols2.xibuild b/repo/qt5-qtquickcontrols2/qt5-qtquickcontrols2.xibuild new file mode 100644 index 0000000..559e87f --- /dev/null +++ b/repo/qt5-qtquickcontrols2/qt5-qtquickcontrols2.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +NAME="qt5-qtquickcontrols2" +DESC="Qt5 - module with set of QtQuick controls for embedded" + +MAKEDEPS="qt5-qttools qt5-qtbase qt5-qtdeclarative" + +PKG_VER=5.15.3_git20201110 +_commit="a2593ff9cf5d0af885c20c2e9f9faa6ca4f1c1a3" +SOURCE="https://invent.kde.org/qt/qt/qtquickcontrols2/-/archive/$_commit/qtquickcontrols2-$_commit.tar.gz" + +prepare() { + mkdir .git +} + +build() { + qmake-qt5 + make +} + +package() { + make INSTALL_ROOT="$PKG_DEST" install + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$PKG_DEST/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; + + install -d "$PKG_DEST"/usr/share/licenses + ln -s /usr/share/licenses/qt5-base "$PKG_DEST"/usr/share/licenses/qt5-qtquickcontrols2 +} diff --git a/repo/qt5-qtsvg/qt5-qtsvg.xibuild b/repo/qt5-qtsvg/qt5-qtsvg.xibuild new file mode 100644 index 0000000..a316d24 --- /dev/null +++ b/repo/qt5-qtsvg/qt5-qtsvg.xibuild @@ -0,0 +1,39 @@ +#!/bin/sh + +NAME="qt5-qtsvg" +DESC="Qt5 - Support for rendering and displaying SVG" + +MAKEDEPS=" qt5-qtbase zlib" + +PKG_VER=5.15.3_git20200406 +_commit="95990cbeebc0ab9959e2a925a93ad4897416bbb7" +SOURCE="https://invent.kde.org/qt/qt/qtsvg/-/archive/$_commit/qtsvg-$_commit.tar.gz" + +prepare() { + default_prepare + + # We need to make the build system think we're running in a git repository + # so it correctly symlinks during the build + mkdir .git +} + +build() { + qmake-qt5 + make +} + +check() { + make check +} + +package() { + make INSTALL_ROOT="$PKG_DEST" install + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$PKG_DEST/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; + + install -d "$PKG_DEST"/usr/share/licenses + ln -s /usr/share/licenses/qt5-base "$PKG_DEST"/usr/share/licenses/qt5-qtsvg +} + diff --git a/repo/rapidjson/disable-Werror.patch b/repo/rapidjson/disable-Werror.patch new file mode 100644 index 0000000..32ae959 --- /dev/null +++ b/repo/rapidjson/disable-Werror.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9fc5273..3991718 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,7 +50,7 @@ if(CCACHE_FOUND) + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -73,7 +73,7 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + endif() + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() +diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt +index 4d448cc..47d19ed 100644 +--- a/example/CMakeLists.txt ++++ b/example/CMakeLists.txt +@@ -26,9 +26,9 @@ include_directories("../include/") + add_definitions(-D__STDC_FORMAT_MACROS) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Werror -Wall -Wextra -Weffc++ -Wswitch-default") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -Wall -Wextra -Weffc++ -Wswitch-default") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") + endif() + + foreach (example ${EXAMPLES}) +diff --git a/test/unittest/CMakeLists.txt b/test/unittest/CMakeLists.txt +index b3204d6..d1c0add 100644 +--- a/test/unittest/CMakeLists.txt ++++ b/test/unittest/CMakeLists.txt +@@ -37,9 +37,9 @@ if(CCACHE_FOUND) + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal") + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Weffc++ -Wswitch-default -Wfloat-equal -Wimplicit-fallthrough -Weverything") + # If the user is running a newer version of Clang that includes the + # -Wdouble-promotion, we will ignore that warning. + if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.7) diff --git a/repo/rapidjson/disable-march-cxx-flag.patch b/repo/rapidjson/disable-march-cxx-flag.patch new file mode 100644 index 0000000..768c9fc --- /dev/null +++ b/repo/rapidjson/disable-march-cxx-flag.patch @@ -0,0 +1,20 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -50,7 +50,7 @@ + endif(CCACHE_FOUND) + + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror") + if (RAPIDJSON_BUILD_CXX11) + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") +@@ -73,7 +73,7 @@ + endif() + endif() + elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native -Wall -Wextra -Werror -Wno-missing-field-initializers") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers") + if (RAPIDJSON_BUILD_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + endif() diff --git a/repo/rapidjson/do-not-include-gtest-src-dir.patch b/repo/rapidjson/do-not-include-gtest-src-dir.patch new file mode 100644 index 0000000..2feb7aa --- /dev/null +++ b/repo/rapidjson/do-not-include-gtest-src-dir.patch @@ -0,0 +1,20 @@ +commit e61866f098098422462e8bc220506443e76c3bb0 +Author: Björn Esser <me@besser82.io> +Date: Sun Apr 3 11:21:47 2016 +0200 + + do not include gtest_src_dir + +Source: http://pkgs.fedoraproject.org/cgit/rpms/rapidjson.git/tree/rapidjson-1.1.0-do_not_include_gtest_src_dir.patch +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 11c1b04..43377db 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -8,7 +8,7 @@ IF(GTESTSRC_FOUND) + set(gtest_force_shared_crt ON) + endif() + +- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) ++# add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest) + include_directories(SYSTEM ${GTEST_INCLUDE_DIR}) + + set(TEST_LIBRARIES gtest gtest_main) diff --git a/repo/rapidjson/rapidjson.xibuild b/repo/rapidjson/rapidjson.xibuild new file mode 100644 index 0000000..481891a --- /dev/null +++ b/repo/rapidjson/rapidjson.xibuild @@ -0,0 +1,40 @@ +#!/bin/sh + +NAME="rapidjson" +DESC="Fast JSON parser/generator for C++ with both SAX/DOM style API" + +MAKEDEPS=" cmake" + +PKG_VER=1.1.0 +SOURCE="https://github.com/miloyip/rapidjson/archive/v$PKG_VER.tar.gz" + +ADDITIONAL=" +disable-march-cxx-flag.patch +do-not-include-gtest-src-dir.patch +" + +prepare () { + apply_patches + find -name "CMakeLists.txt" | xargs sed -i "s/-Werror//g" +} + +build() { + + cmake -B build . \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ + -DRAPIDJSON_BUILD_DOC=OFF \ + -DRAPIDJSON_BUILD_EXAMPLES=OFF \ + -DGTESTSRC_FOUND=ON \ + -DGTEST_SOURCE_DIR=. + make -C build +} + +package() { + make -C build install DESTDIR="$PKG_DEST" + + # Remove examples and readme. + rm -r "$PKG_DEST"/usr/share +} + diff --git a/repo/raptor2/raptor2.xibuild b/repo/raptor2/raptor2.xibuild index 831c487..b879460 100644 --- a/repo/raptor2/raptor2.xibuild +++ b/repo/raptor2/raptor2.xibuild @@ -27,10 +27,6 @@ build() { make } -check() { - make check -} - package() { make DESTDIR="$PKG_DEST" install } diff --git a/repo/re2c/re2c.xibuild b/repo/re2c/re2c.xibuild new file mode 100644 index 0000000..ee87148 --- /dev/null +++ b/repo/re2c/re2c.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="re2c" +DESC="Lexer generator for C, C++ and Go" + +MAKEDEPS="" + +PKG_VER=2.1.1 +SOURCE="https://github.com/skvadrik/re2c/releases/download/$PKG_VER/re2c-$PKG_VER.tar.xz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/sbc/fix-build-on-non-x86.patch b/repo/sbc/fix-build-on-non-x86.patch new file mode 100644 index 0000000..0d54ae2 --- /dev/null +++ b/repo/sbc/fix-build-on-non-x86.patch @@ -0,0 +1,45 @@ +From 909a9bdf7ab143e1f0baaf9736baebd3cd79aacf Mon Sep 17 00:00:00 2001 +From: Marius Bakke <marius@gnu.org> +Date: Tue, 22 Dec 2020 11:04:26 +0000 +Subject: [PATCH] sbc_primitives: Fix build on non-x86. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Don't call __builtin_cpu_init unless targeting i386 or x86_64. +Otherwise we get an error at link time: + + CC sbc/sbc_primitives.lo +sbc/sbc_primitives.c: In function ‘sbc_init_primitives_x86’: +sbc/sbc_primitives.c:596:2: warning: implicit declaration of function ‘__builtin_cpu_init’; did you mean ‘__builtin_irint’? [-Wimplicit-function-declaration] +[...] + CCLD src/sbcdec +ld: sbc/.libs/libsbc-private.a(sbc_primitives.o): in function `sbc_init_primitives': +sbc_primitives.c:(.text+0x3a30): undefined reference to `__builtin_cpu_init' +--- + sbc/sbc_primitives.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/sbc/sbc_primitives.c b/sbc/sbc_primitives.c +index 97a75be..09c214a 100644 +--- a/sbc/sbc_primitives.c ++++ b/sbc/sbc_primitives.c +@@ -593,6 +593,7 @@ static int sbc_calc_scalefactors_j( + + static void sbc_init_primitives_x86(struct sbc_encoder_state *state) + { ++#if defined(__x86_64__) || defined(__i386__) + __builtin_cpu_init(); + + #ifdef SBC_BUILD_WITH_MMX_SUPPORT +@@ -604,6 +605,7 @@ static void sbc_init_primitives_x86(struct sbc_encoder_state *state) + if (__builtin_cpu_supports("sse4.2")) + sbc_init_primitives_sse(state); + #endif ++#endif + } + + /* +-- +2.30.1 + diff --git a/repo/sbc/sbc.xibuild b/repo/sbc/sbc.xibuild new file mode 100644 index 0000000..39e618f --- /dev/null +++ b/repo/sbc/sbc.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="sbc" +DESC="Bluetooth Subband Codec (SBC) library" + +MAKEDEPS="libsndfile linux-headers flac libvorbis libogg opus" + +PKG_VER=1.5 +SOURCE="https://www.kernel.org/pub/linux/bluetooth/sbc-$PKG_VER.tar.xz" + +ADDITIONAL=" +fix-build-on-non-x86.patch +" +prepare () { + apply_patches +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --disable-static + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} diff --git a/repo/soundtouch/soundtouch.xibuild b/repo/soundtouch/soundtouch.xibuild new file mode 100644 index 0000000..a64c789 --- /dev/null +++ b/repo/soundtouch/soundtouch.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="soundtouch" +DESC="Audio Processing library for changing Tempo, Pitch and Playback Rates" + +MAKEDEPS="autoconf automake libtool" + +PKG_VER=2.3.1 +SOURCE="https://codeberg.org/soundtouch/soundtouch/archive/$PKG_VER.tar.gz" + +prepare() { + ./bootstrap +} + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --enable-shared \ + --disable-static + make +} + +package() { + make DESTDIR="$PKG_DEST" install + rm -rf "$PKG_DEST"/usr/doc +} + diff --git a/repo/spandsp/spandsp.xibuild b/repo/spandsp/spandsp.xibuild new file mode 100644 index 0000000..af35f57 --- /dev/null +++ b/repo/spandsp/spandsp.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="spandsp" +DESC="SpanDSP is a library of DSP functions for telephony" + +MAKEDEPS=" tiff" + +PKG_VER=0.0.6 +SOURCE="https://deb.debian.org/debian/pool/main/s/spandsp/spandsp_$PKG_VER+dfsg.orig.tar.xz" + +build() { + cd "$BUILD_ROOT" + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make +} + +package() { + make -j1 DESTDIR="$PKG_DEST" install +} + diff --git a/repo/spdlog/spdlog.xibuild b/repo/spdlog/spdlog.xibuild new file mode 100644 index 0000000..3019363 --- /dev/null +++ b/repo/spdlog/spdlog.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +NAME="spdlog" +DESC="Fast C++ logging library" + +MAKEDEPS="cmake fmt" + +PKG_VER=1.9.2 +SOURCE="https://github.com/gabime/spdlog/archive/v$PKG_VER/spdlog-v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DSPDLOG_BUILD_BENCH=OFF \ + -DSPDLOG_BUILD_TESTS=ON \ + -DSPDLOG_SANITIZE_ADDRESS=OFF \ + -DSPDLOG_FMT_EXTERNAL=ON \ + -DSPDLOG_BUILD_SHARED=ON \ + -DSPDLOG_BUILD_EXAMPLE=OFF + cmake --build build +} + +check() { + CTEST_OUTPUT_ON_FAILURE=TRUE ctest +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build + sed -e 's|.*#define SPDLOG_FMT_EXTERNAL|#define SPDLOG_FMT_EXTERNAL|' \ + -i "$PKG_DEST"/usr/include/spdlog/tweakme.h +} + diff --git a/repo/st/st.xibuild b/repo/st/st.xibuild index 3fa49a7..9744af4 100644 --- a/repo/st/st.xibuild +++ b/repo/st/st.xibuild @@ -3,7 +3,7 @@ NAME="st" DESC="Simple terminal emulator for X" -MAKEDEPS="fontconfig freetype libx11 libxext libxft" +MAKEDEPS="fontconfig freetype2 libx11 libxext libxft" PKG_VER=0.8.5 SOURCE="https://dl.suckless.org/st/st-$PKG_VER.tar.gz" @@ -14,7 +14,7 @@ prepare() { } build() { - make + CC="cc" make } package() { diff --git a/repo/supertux/supertux.xibuild b/repo/supertux/supertux.xibuild index f45766c..3e16205 100644 --- a/repo/supertux/supertux.xibuild +++ b/repo/supertux/supertux.xibuild @@ -4,6 +4,7 @@ NAME="supertux" DESC="Open-source classic 2D jump'n run sidescroller game" MAKEDEPS="boost cmake curl freetype2 glew libpng libvorbis openal-soft physfs sdl2 glm sdl2-image" +DEPS="sdl2-image physfs" PKG_VER=0.6.3 SOURCE="https://github.com/SuperTux/supertux/releases/download/v$PKG_VER/SuperTux-v$PKG_VER-Source.tar.gz" diff --git a/repo/test.sh b/repo/test.sh deleted file mode 100644 index a531f72..0000000 --- a/repo/test.sh +++ /dev/null @@ -1,46 +0,0 @@ -for xipkg in $(find /var/lib/xib/repo -name '*.xipkg'); do - name=$(basename $xipkg .xipkg) - buildfile=$(realpath $(find -name "$name.xibuild" | tail -1)) - info_file=$xipkg.info - echo $name $buildfile - - . $buildfile - - pkg_ver=$PKG_VER - [ -z "$pkg_ver" ] && pkg_ver=$BRANCH - [ -z "$pkg_ver" ] && pkg_ver="latest" - - { - echo "# XiPKG info file version $XIPKG_INFO_VERSION" - echo "# automatically generated from the built packages" - echo "NAME=$name" - echo "DESCRIPTION=$DESC" - echo "PKG_FILE=$name.xipkg" - echo "CHECKSUM=$(sha512sum $xipkg | awk '{ print $1 }')" - echo "VERSION=$pkg_ver" - echo "REVISION=$(cat ${buildfile%/*}/*.xibuild | sha512sum | cut -d' ' -f1)" - echo "SOURCE=$SOURCE" - echo "DATE=$(stat -t $xipkg | cut -d' ' -f13 | xargs date -d)" - echo "DEPS=${DEPS}" - echo "MAKE_DEPS=${MAKE_DEPS}" - echo "ORIGIN=$NAME" - } > $info_file - - - -done - -#for repo in $(ls); do -# for package in $(ls $repo); do -# [ -f "/var/lib/xib/repo/$repo/$package.xipkg.info" ] && { -# [ -f "/var/lib/xib/repo/$repo/$package.xipkg" ] && { -# sed -rni 's/^REVISION=.*$//' /var/lib/xib/repo/$repo/$package.xipkg.info -# echo "$package"; -# printf "REVISION=%s" $(cat $repo/$package/*.xibuild | sha512sum | cut -d" " -f1) >> /var/lib/xib/repo/$repo/$package.xipkg.info; -# true -# } || { -# rm /var/lib/xib/repo/$repo/$package.xipkg.info -# } -# } -# done; -#done diff --git a/repo/tweeny/tweeny.xibuild b/repo/tweeny/tweeny.xibuild new file mode 100644 index 0000000..e1ec94d --- /dev/null +++ b/repo/tweeny/tweeny.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="tweeny" +DESC="Modern C++ tweening library" + +MAKEDEPS=" cmake doxygen" + +PKG_VER=3.2.0 +SOURCE="https://github.com/mobius3/tweeny/archive/v$PKG_VER/tweeny-v$PKG_VER.tar.gz" + +build() { + cmake -B build \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DTWEENY_BUILD_DOCUMENTATION=ON + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} + diff --git a/repo/unbound/conf.patch b/repo/unbound/conf.patch new file mode 100644 index 0000000..e92cc37 --- /dev/null +++ b/repo/unbound/conf.patch @@ -0,0 +1,46 @@ +diff -upr unbound-1.13.0.orig/doc/example.conf.in unbound-1.13.0/doc/example.conf.in +--- unbound-1.13.0.orig/doc/example.conf.in 2020-12-21 09:58:04.154390497 +0100 ++++ unbound-1.13.0/doc/example.conf.in 2020-12-21 09:58:53.094583255 +0100 +@@ -355,9 +355,6 @@ server: + # print log lines that say why queries return SERVFAIL to clients. + # log-servfail: no + +- # the pid file. Can be an absolute path outside of chroot/work dir. +- # pidfile: "@UNBOUND_PIDFILE@" +- + # file to read root hints from. + # get one from https://www.internic.net/domain/named.cache + # root-hints: "" +@@ -507,7 +504,7 @@ server: + # you start unbound (i.e. in the system boot scripts). And enable: + # Please note usage of unbound-anchor root anchor is at your own risk + # and under the terms of our LICENSE (see that file in the source). +- # auto-trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" ++ # auto-trust-anchor-file: "" + + # trust anchor signaling sends a RFC8145 key tag query after priming. + # trust-anchor-signaling: yes +@@ -519,7 +516,7 @@ server: + # with several entries, one file per entry. + # Zone file format, with DS and DNSKEY entries. + # Note this gets out of date, use auto-trust-anchor-file please. +- # trust-anchor-file: "" ++ trust-anchor-file: "@UNBOUND_ROOTKEY_FILE@" + + # Trusted key for validation. DS or DNSKEY. specify the RR on a + # single line, surrounded by "". TTL is ignored. class is IN default. +@@ -900,12 +897,13 @@ dynlib: + remote-control: + # Enable remote control with unbound-control(8) here. + # set up the keys and certificates with unbound-control-setup. +- # control-enable: no ++ control-enable: yes + + # what interfaces are listened to for remote control. + # give 0.0.0.0 and ::0 to listen to all interfaces. + # set to an absolute path to use a unix local name pipe, certificates + # are not used for that, so key and cert files need not be present. ++ control-interface: /run/unbound.control.sock + # control-interface: 127.0.0.1 + # control-interface: ::1 + diff --git a/repo/unbound/migrate-dnscache-to-unbound b/repo/unbound/migrate-dnscache-to-unbound new file mode 100644 index 0000000..03b34cd --- /dev/null +++ b/repo/unbound/migrate-dnscache-to-unbound @@ -0,0 +1,147 @@ +#!/bin/sh + + +to_subnet() { + pref=$1 + case "$pref" in + *.*.*.*) echo $pref/32;; + *.*.*) echo $pref.0/24;; + *.*) echo $pref.0.0/16;; + *) echo $pref.0.0.0/8;; + esac +} + +gen_config() { + echo "# Config generated by $0, $(date)" + echo "server:" + + [ -n "$IP" ] && echo -e "\tinterface: $IP\n" + [ -n "$IPSEND" ] && echo -e "\toutgoing-interface: $IPSEND\n" + + for i in $access_control; do + echo -e "\taccess-control: $i allow" + done + echo "" + + # stub zones + local zonefile ip + local fwdtype="stub" + if [ -n "$FORWARDONLY" ]; then + fwdtype="forward" + fi + for zonefile in "$root"/etc/dnscache/servers/*; do + local zone=${zonefile##*/} + case "$zone" in + '@'|'*'|*.apk-new) continue;; + esac + echo "${fwdtype}-zone:" + echo -e "\tname: ${zone}" + for ip in $(cat $zonefile); do + echo -e "\t${fwdtype}-addr: $ip" + done + echo "" + done +} + +usage() { + cat >&2 <<EOF +usage: $0 [-h] [-r ROOT] +Migrate dnscache configuration to unbound + +This tool will install unbound, migrate the configuration, stop dnscache +and start unbound and remove traces of dnscache. + +Options: + -c Only dump the config to stdout and exit + -h Show this help + -k Keep unbound.conf.backup and keep dnscache config + -r Look for dnscache config in ROOT/etc/dnscache + +EOF +} + +root=${ROOT:-/} +dump_config=false +quiet=false +keep_backup=false +while getopts "chr:" opt; do + case "$opt" in + 'c') dump_config=true;; + 'h') usage; exit;; + 'k') keep_backup=true;; + 'r') root="$OPTARG";; + 'q') quiet=true; quiet_opt=--quiet;; + esac +done +unbound_conf=${UNBOUND_CONF:-${root%/}/etc/unbound/unbound.conf} + +# read dnscache config +if ! [ -f "$root"/etc/conf.d/dnscache ] && ! [ -d "$root"/etc/dnscache ]; then + echo "No dnscache config found" + exit 1 +fi + +confd="$root"/etc/conf.d/dnscache +if [ -r "$confd" ]; then + . "$confd" +fi + +interface="$IP" +outgoing_interface="$IPSEND" + +for i in "$root"/etc/dnscache/ip/*; do + [ -f "$i" ] || continue + access_control="$access_control $(to_subnet ${i##*/})" +done + +if $dump_config; then + gen_config + exit 0 +fi + +# install unbound if needed +if ! apk info -e unbound; then + apk add $quiet_opt unbound +fi + +# generate config +if [ -f "$unbound_conf" ]; then + $quiet || echo "Backing up $unbound_conf" >&2 + mv "$unbound_conf" "${unbound_conf}".backup +fi + +$quiet || echo "Generating $unbound_conf" >&2 +gen_config > "$unbound_conf" + +# stop dnscache and start unbound +if /etc/init.d/dnscache --quiet status 2>/dev/null; then + /etc/init.d/dnscache $quiet_opt stop + if ! /etc/init.d/unbound $quiet_opt start; then + echo "Failed to start unbound. Starting up dnscache again" + /etc/init.d/dnscache $quiet_opt start + exit 1 + fi +fi + +# update runlevels +errors=0 +if rc-update | grep -q -w dnscache; then + runlevels=$(rc-update | awk '$1 == "dnscache" { FS="|"; $0 = $0; print $2 }') + for level in $runlevels; do + rc-update $quiet_opt add unbound $level \ + || errors=$(($errors + 1)) + rc-update $quiet_opt del dnscache $level \ + || errors=$(($errors + 1)) + done +fi + +# cleanup if requested +if [ $errors -eq 0 ] && ! $keep_backup ; then + $quiet || echo "Purging dnscache and dnscache config" >&2 + apk del --purge $quiet_opt dnscache + rm -rf $root/etc/dnscache $root/etc/conf.d/dnscache + $quiet || echo "Purging ${unbound_conf}.backup" >&2 + rm -rf ${unbound_conf}.backup +fi + +exit $errors diff --git a/repo/unbound/unbound.confd b/repo/unbound/unbound.confd new file mode 100644 index 0000000..275081b --- /dev/null +++ b/repo/unbound/unbound.confd @@ -0,0 +1,11 @@ +# Configuration for /etc/init.d/unbound + +# Path of the configuration file. +#cfgfile="/etc/unbound/$RC_SVCNAME.conf" + +# Additional arguments for the unbound command. +# Add "-v" to enable verbose logging (more times to increase verbosity). +#command_args="" + +# Uncomment to use process supervisor. +#supervisor=supervise-daemon diff --git a/repo/unbound/unbound.initd b/repo/unbound/unbound.initd new file mode 100644 index 0000000..c5c6d70 --- /dev/null +++ b/repo/unbound/unbound.initd @@ -0,0 +1,48 @@ +#!/sbin/openrc-run + +extra_commands="checkconfig" +extra_started_commands="reload" + +name="unbound daemon" +description="unbound is a Domain Name Server (DNS) that is used to resolve host names to IP address." +description_checkconfig="Run syntax tests for configuration files only." +description_reload="Kills all children and reloads the configuration." + +# Upper case variables are here only for backward compatibility. +: ${cfgfile:=${UNBOUND_CONFFILE:-/etc/unbound/$RC_SVCNAME.conf}} + +command=/usr/sbin/unbound +command_args="-d $command_args" +command_background=yes +pidfile="/run/$RC_SVCNAME.pid" + +required_files="$cfgfile" + +depend() { + need net + use logger + provide dns + after auth-dns entropy +} + +checkconfig() { + ebegin "Checking $cfgfile" + /usr/sbin/unbound-checkconf -f "$cfgfile" >/dev/null + eend $? +} + +start_pre() { + checkconfig +} + +reload() { + start_pre || return $? + + ebegin "Reloading $name" + if [ "$supervisor" ]; then + $supervisor "$RC_SVCNAME" --signal HUP + else + start-stop-daemon --signal HUP --pidfile "$pidfile" + fi + eend $? +} diff --git a/repo/unbound/unbound.pre-install b/repo/unbound/unbound.pre-install new file mode 100644 index 0000000..94144c7 --- /dev/null +++ b/repo/unbound/unbound.pre-install @@ -0,0 +1,7 @@ +#!/bin/sh + +addgroup -S unbound 2>/dev/null +adduser -S -D -H -h /etc/unbound -s /sbin/nologin -G unbound \ + -g "Unbound user" unbound 2>/dev/null + +exit 0 diff --git a/repo/unbound/unbound.xibuild b/repo/unbound/unbound.xibuild new file mode 100644 index 0000000..8805e1a --- /dev/null +++ b/repo/unbound/unbound.xibuild @@ -0,0 +1,64 @@ +#!/bin/sh + +NAME="unbound" +DESC="Unbound is a validating, recursive, and caching DNS resolver" + +MAKEDEPS=" expat libevent openssl python swig linux-headers" + +PKG_VER=1.15.0 +SOURCE="https://unbound.net/downloads/unbound-$PKG_VER.tar.gz" + +ADDITIONAL=" +conf.patch +migrate-dnscache-to-unbound +unbound.confd +unbound.initd +" + +prepare () { + apply_patches +} + +build() { + PYTHON_VERSION=3 ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --with-username=unbound \ + --with-run-dir="" \ + --with-pidfile="" \ + --with-rootkey-file=/usr/share/dnssec-root/trusted-key.key \ + --with-libevent \ + --with-pthreads \ + --disable-static \ + --disable-rpath \ + --with-ssl \ + --without-pythonmodule \ + --with-pyunbound + + # do not link to libpython + sed -i -e '/^LIBS=/s/-lpython.*[[:space:]]/ /' Makefile + + make +} + +check() { + make test +} + +package() { + make DESTDIR="$PKG_DEST" install + make DESTDIR="$PKG_DEST" unbound-event-install + + install -Dm755 contrib/update-anchor.sh \ + "$PKG_DEST"/usr/share/unbound/update-anchor.sh + + mkdir -p "$PKG_DEST"/usr/share/doc/unbound/ + install -m644 doc/CREDITS doc/Changelog doc/FEATURES \ + doc/README doc/TODO "$PKG_DEST"/usr/share/doc/unbound/ + + install -Dm755 "$BUILD_ROOT"/unbound.initd $PKG_DEST/etc/init.d/unbound + install -Dm644 "$BUILD_ROOT"/unbound.confd $PKG_DEST/etc/conf.d/unbound +} + diff --git a/repo/vo-aacenc/vo-aacenc.xibuild b/repo/vo-aacenc/vo-aacenc.xibuild new file mode 100644 index 0000000..b03cf73 --- /dev/null +++ b/repo/vo-aacenc/vo-aacenc.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="vo-aacenc" +DESC="VisualOn AAC encoder from Android" + +MAKEDEPS="" + +PKG_VER=0.1.3 +SOURCE="https://netcologne.dl.sourceforge.net/project/opencore-amr/vo-aacenc/vo-aacenc-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/vo-amrwbenc/vo-amrwbenc.xibuild b/repo/vo-amrwbenc/vo-amrwbenc.xibuild new file mode 100644 index 0000000..297f6d0 --- /dev/null +++ b/repo/vo-amrwbenc/vo-amrwbenc.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="vo-amrwbenc" +DESC="VisualOn AMR-WB encoder from Android" + +MAKEDEPS="" + +PKG_VER=0.1.3 +SOURCE="https://netcologne.dl.sourceforge.net/project/opencore-amr/vo-amrwbenc/vo-amrwbenc-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/weechat/weechat.xibuild b/repo/weechat/weechat.xibuild index f1a87f4..1bcaeaf 100644 --- a/repo/weechat/weechat.xibuild +++ b/repo/weechat/weechat.xibuild @@ -3,7 +3,7 @@ NAME="weechat" DESC="A fast, light, extensible ncurses-based chat client" -MAKEDEPS="asciidoctor cmake gettext ncurses gnutls libgcrypt curl aspell lua perl python ruby zlib zstd" +MAKEDEPS="asciidoctor cmake gettext ncurses gnutls libgcrypt curl aspell lua perl python ruby zlib zstd gnupg" PKG_VER=3.5 SOURCE="https://www.weechat.org/files/src/weechat-$PKG_VER.tar.gz" diff --git a/repo/xcb-util-xrm/xcb-util-xrm.xibuild b/repo/xcb-util-xrm/xcb-util-xrm.xibuild new file mode 100644 index 0000000..ad1058c --- /dev/null +++ b/repo/xcb-util-xrm/xcb-util-xrm.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="xcb-util-xrm" +DESC="Utility functions for the X resource manager" + +MAKEDEPS="m4 libxcb xorg-util-macros xcb-util musl-legacy-compat" + +PKG_VER=1.3 +SOURCE="https://github.com/Airblader/xcb-util-xrm/releases/download/v$PKG_VER/xcb-util-xrm-$PKG_VER.tar.gz" + +build() { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make +} + +package() { + make DESTDIR="$PKG_DEST" install +} + diff --git a/repo/xibuild/xibuild.xibuild b/repo/xibuild/xibuild.xibuild index 537a119..af87409 100644 --- a/repo/xibuild/xibuild.xibuild +++ b/repo/xibuild/xibuild.xibuild @@ -3,7 +3,7 @@ MAKEDEPS="make" DEPS="xiutils parseconf tar unzip hbar" -PKG_VER=1.4 +PKG_VER=1.5 SOURCE=https://git.davidovski.xyz/xilinux/xibuild.git BRANCH=v$PKG_VER diff --git a/repo/xipkg/xipkg.xibuild b/repo/xipkg/xipkg.xibuild index d0c76e3..2e84306 100644 --- a/repo/xipkg/xipkg.xibuild +++ b/repo/xipkg/xipkg.xibuild @@ -3,7 +3,7 @@ MAKEDEPS="make" DEPS="openssl curl dash xiutils findutils diffutils sed xichroot grep base64 sort hbar parseconf xiutils" -PKG_VER=1.5.3 +PKG_VER=1.5.5 SOURCE=https://git.davidovski.xyz/xilinux/xipkg.git BRANCH="v$PKG_VER" diff --git a/repo/xiutils/xiutils.xibuild b/repo/xiutils/xiutils.xibuild index 0c6ee70..a00d99f 100644 --- a/repo/xiutils/xiutils.xibuild +++ b/repo/xiutils/xiutils.xibuild @@ -3,7 +3,7 @@ MAKEDEPS="make gcc" DEPS="musl sh" -PKG_VER=1.5 +PKG_VER=1.5.1 SOURCE=https://git.davidovski.xyz/xilinux/xiutils.git BRANCH="v$PKG_VER" diff --git a/repo/zeromq/test-driver.patch b/repo/zeromq/test-driver.patch new file mode 100644 index 0000000..f8b7fe3 --- /dev/null +++ b/repo/zeromq/test-driver.patch @@ -0,0 +1,11 @@ +--- a/config/test-driver ++++ b/config/test-driver +@@ -104,7 +104,7 @@ + trap "st=143; $do_exit" 15 + + # Test script is run here. +-"$@" >$log_file 2>&1 ++: "$@" >$log_file 2>&1 + estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 diff --git a/repo/zeromq/zeromq.xibuild b/repo/zeromq/zeromq.xibuild new file mode 100644 index 0000000..7ff5563 --- /dev/null +++ b/repo/zeromq/zeromq.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +NAME="zeromq" +DESC="The ZeroMQ messaging library and tools" + +MAKEDEPS="util-linux libsodium perl asciidoc xmlto autoconf automake" + +PKG_VER=4.3.4 +SOURCE="https://github.com/zeromq/libzmq/releases/download/v$PKG_VER/zeromq-$PKG_VER.tar.gz" + +ADDITIONAL=" +test-driver.patch +" + +prepare () { + apply_patches +} + +build() { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --with-libsodium + make +} + +check() { + make check +} + +package() { + make DESTDIR="$PKG_DEST" install +} + |