From 739c65c54cb0e957df5e9b76f93fb02554e5cac3 Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 4 May 2022 23:52:30 +0100 Subject: moved everything to new file formatting --- repo/system/acl.xibuild | 17 - repo/system/acl/acl.xibuild | 17 + repo/system/acpid.xibuild | 37 - repo/system/acpid/acpid.confd | 7 + repo/system/acpid/acpid.initd | 28 + repo/system/acpid/acpid.xibuild | 37 + repo/system/acpid/anything | 3 + repo/system/acpid/handler.sh | 36 + repo/system/acpid/lid-closed | 21 + repo/system/acpid/power-supply-ac | 25 + repo/system/argp-standalone.xibuild | 26 - .../system/argp-standalone/argp-standalone.xibuild | 26 + repo/system/at-spi2-atk.xibuild | 22 - repo/system/at-spi2-atk/at-spi2-atk.xibuild | 22 + repo/system/at-spi2-core.xibuild | 27 - repo/system/at-spi2-core/at-spi2-core.xibuild | 27 + repo/system/atk.xibuild | 22 - repo/system/atk/atk.xibuild | 22 + repo/system/attr.xibuild | 28 - repo/system/attr/attr.xibuild | 28 + repo/system/binutils.xibuild | 69 - ...882-.gnu.attributes-are-not-checked-for-s.patch | 55 + ...-file-desriptor-if-there-is-no-archive-fd.patch | 234 +++ .../binutils/binutils-ld-fix-static-linking.patch | 46 + repo/system/binutils/binutils.xibuild | 69 + repo/system/binutils/defang-no-split.patch | 38 + repo/system/binutils/gold-mips.patch | 39 + repo/system/binutils/ld-bfd-mips.patch | 19 + repo/system/brotli.xibuild | 21 - repo/system/brotli/brotli.xibuild | 21 + repo/system/bzip2.xibuild | 38 - repo/system/bzip2/bzip2.xibuild | 38 + repo/system/c-ares.xibuild | 23 - repo/system/c-ares/c-ares.xibuild | 23 + repo/system/cacerts.xibuild | 30 - repo/system/cacerts/cacerts.xibuild | 30 + repo/system/cacerts/fix-sbase-coreutils.patch | 12 + repo/system/cairo.xibuild | 39 - repo/system/cairo/cairo.xibuild | 39 + .../cairo/fix-mask-usage-in-image-compositor.patch | 172 ++ repo/system/cairo/musl-stacksize.patch | 23 + ...pdf-font-subset-Generate-valid-font-names.patch | 58 + repo/system/dbus.xibuild | 60 - repo/system/dbus/dbus.confd | 7 + repo/system/dbus/dbus.initd | 33 + repo/system/dbus/dbus.trigger | 4 + repo/system/dbus/dbus.xibuild | 60 + repo/system/dhcp.xibuild | 69 - .../dhcp/01-dhclient-script-fix-bare-ip.patch | 13 + .../dhcp/02-dhclient-script-remove-bashisms.patch | 28 + repo/system/dhcp/03-fix-unwind-import.patch | 16 + repo/system/dhcp/dhcp.xibuild | 69 + repo/system/dhcp/dhcpd.confd | 28 + repo/system/dhcp/dhcpd.initd | 115 ++ repo/system/efibootmgr.xibuild | 21 - repo/system/efibootmgr/efibootmgr.xibuild | 21 + repo/system/efivar.xibuild | 35 - repo/system/efivar/efivar.xibuild | 35 + .../efivar/patches/efivar-fix-format_guid.patch | 56 + repo/system/efivar/patches/efivar-fix-packed.patch | 168 ++ repo/system/efivar/patches/efivar-fix-ucs2.patch | 59 + repo/system/efivar/patches/musl-bswap.patch | 33 + repo/system/elfutils.xibuild | 54 - repo/system/elfutils/elfutils.xibuild | 54 + repo/system/elfutils/files/error.h | 27 + .../elfutils/patches/fix-aarch64_fregs.patch | 14 + .../elfutils/patches/fix-uninitialized.patch | 17 + .../elfutils/patches/musl-asm-ptrace-h.patch | 10 + repo/system/elfutils/patches/musl-macros.patch | 87 + repo/system/elfutils/patches/musl-strndupa.patch | 18 + repo/system/elogind.xibuild | 93 -- repo/system/elogind/elogind.initd | 23 + repo/system/elogind/elogind.xibuild | 93 ++ repo/system/elogind/id-nobody.patch | 13 + repo/system/elogind/mips.patch | 11 + repo/system/elogind/ppc64-bad-tuple.patch | 25 + repo/system/elogind/ppcle.patch | 25 + repo/system/eudev.xibuild | 41 - repo/system/eudev/default-rules.patch | 9 + repo/system/eudev/eudev.xibuild | 41 + repo/system/eudev/load-fbcon.patch | 10 + repo/system/eudev/udev.initd | 22 + repo/system/eudev/udev_retry.initd | 31 + repo/system/execline.xibuild | 24 - repo/system/execline/execline.xibuild | 24 + repo/system/expat.xibuild | 22 - repo/system/expat/expat.xibuild | 22 + repo/system/findutils.xibuild | 19 - repo/system/findutils/findutils.xibuild | 19 + repo/system/freetype2.xibuild | 24 - repo/system/freetype2/freetype2.xibuild | 24 + repo/system/fribidi.xibuild | 22 - repo/system/fribidi/fribidi.xibuild | 22 + repo/system/gc.xibuild | 17 - repo/system/gc/gc.xibuild | 17 + repo/system/gdbm.xibuild | 21 - repo/system/gdbm/gdbm.xibuild | 21 + repo/system/gettext.xibuild | 28 - repo/system/gettext/gettext.xibuild | 28 + repo/system/glew.xibuild | 20 - repo/system/glew/glew.patch | 34 + repo/system/glew/glew.xibuild | 20 + repo/system/glib.xibuild | 36 - ...rk-fix-initialization-with-c-constructors.patch | 47 + repo/system/glib/deprecated-no-warn.patch | 23 + repo/system/glib/glib.xibuild | 36 + repo/system/glib/musl-libintl.patch | 22 + repo/system/glm.xibuild | 35 - repo/system/glm/fix-endian-test.patch | 30 + repo/system/glm/glm.pc | 7 + repo/system/glm/glm.xibuild | 35 + repo/system/glu.xibuild | 24 - repo/system/glu/glu.xibuild | 24 + repo/system/gmp.xibuild | 31 - repo/system/gmp/gmp.xibuild | 31 + repo/system/gnutls.xibuild | 19 - repo/system/gnutls/gnutls.xibuild | 19 + repo/system/gobject-introspection.xibuild | 26 - .../gobject-introspection.xibuild | 26 + .../system/gobject-introspection/musl-time64.patch | 37 + repo/system/gperf.xibuild | 17 - repo/system/gperf/gperf.xibuild | 17 + repo/system/grub.xibuild | 43 - repo/system/grub/grub.xibuild | 43 + repo/system/guile.xibuild | 19 - repo/system/guile/guile.xibuild | 19 + repo/system/gzip.xibuild | 17 - repo/system/gzip/gzip.xibuild | 17 + repo/system/hwids.xibuild | 20 - repo/system/hwids/hwids.xibuild | 20 + repo/system/iana-etc.xibuild | 15 - repo/system/iana-etc/iana-etc.xibuild | 15 + repo/system/icu.xibuild | 34 - repo/system/icu/fix-ucptrietest-golden-diff.patch | 33 + repo/system/icu/icu.xibuild | 34 + repo/system/imlib2.xibuild | 22 - repo/system/imlib2/imlib2.xibuild | 22 + repo/system/intltool.xibuild | 23 - repo/system/intltool/intltool.xibuild | 23 + repo/system/jansson.xibuild | 24 - repo/system/jansson/jansson.xibuild | 24 + repo/system/js78.xibuild | 66 - repo/system/js78/js78.xibuild | 66 + repo/system/js78/patches/disable-jslint.patch | 17 + .../fd6847c9416f9eebde636e21d794d25d1be8791d.patch | 37 + repo/system/js78/patches/fix-musl-build.patch | 16 + .../js78/patches/fix-python3.10-compilation.patch | 312 ++++ repo/system/js78/patches/fix-rust-target.patch | 15 + repo/system/json-c.xibuild | 23 - repo/system/json-c/json-c.xibuild | 23 + repo/system/json-glib.xibuild | 23 - repo/system/json-glib/json-glib.xibuild | 23 + repo/system/jsoncpp.xibuild | 25 - repo/system/jsoncpp/jsoncpp.xibuild | 25 + repo/system/kbd.xibuild | 23 - repo/system/kbd/kbd.xibuild | 23 + repo/system/kmod.xibuild | 30 - repo/system/kmod/kmod.xibuild | 30 + repo/system/krb5.xibuild | 59 - repo/system/krb5/krb5.xibuild | 59 + repo/system/lcms2.xibuild | 27 - repo/system/lcms2/lcms2.xibuild | 27 + repo/system/ldns.xibuild | 26 - repo/system/ldns/ldns.xibuild | 26 + repo/system/libarchive.xibuild | 23 - repo/system/libarchive/libarchive.xibuild | 23 + repo/system/libcap-ng.xibuild | 19 - repo/system/libcap-ng/libcap-ng.xibuild | 19 + repo/system/libcap.xibuild | 29 - repo/system/libcap/libcap.xibuild | 29 + repo/system/libconfig.xibuild | 27 - repo/system/libconfig/libconfig.xibuild | 27 + repo/system/libdwarf.xibuild | 25 - repo/system/libdwarf/libdwarf.xibuild | 25 + repo/system/libedit.xibuild | 23 - repo/system/libedit/libedit.xibuild | 23 + repo/system/libelf.xibuild | 32 - repo/system/libelf/libelf.xibuild | 32 + repo/system/libev.xibuild | 24 - .../libev/libev-4.11-Add-pkgconfig-support.patch | 58 + repo/system/libev/libev.xibuild | 24 + repo/system/libevent.xibuild | 28 - repo/system/libevent/libevent.xibuild | 28 + repo/system/libexif.xibuild | 23 - repo/system/libexif/libexif.xibuild | 23 + repo/system/libffi.xibuild | 17 - repo/system/libffi/libffi.xibuild | 17 + repo/system/libfm-extra.xibuild | 31 - repo/system/libfm-extra/libfm-extra.xibuild | 31 + repo/system/libfm.xibuild | 31 - repo/system/libfm/libfm.xibuild | 31 + repo/system/libgcrypt.xibuild | 24 - repo/system/libgcrypt/libgcrypt.xibuild | 24 + repo/system/libgpg-error.xibuild | 32 - repo/system/libgpg-error/libgpg-error.xibuild | 32 + repo/system/libgudev.xibuild | 21 - repo/system/libgudev/libgudev.xibuild | 21 + repo/system/libidn.xibuild | 26 - repo/system/libidn/libidn.xibuild | 26 + repo/system/libldap.xibuild | 17 - repo/system/libldap/libldap.xibuild | 17 + repo/system/liblinear.xibuild | 20 - repo/system/liblinear/liblinear.xibuild | 20 + repo/system/libluv.xibuild | 24 - repo/system/libluv/libluv.xibuild | 24 + repo/system/libmbim.xibuild | 22 - repo/system/libmbim/libmbim.xibuild | 22 + repo/system/libmpack.xibuild | 16 - repo/system/libmpack/libmpack.xibuild | 16 + repo/system/libndp.xibuild | 20 - repo/system/libndp/libndp.xibuild | 20 + repo/system/libnghttp.xibuild | 21 - repo/system/libnghttp/libnghttp.xibuild | 21 + repo/system/libnl.xibuild | 27 - repo/system/libnl/libnl.xibuild | 27 + repo/system/libnsl.xibuild | 24 - repo/system/libnsl/libnsl.xibuild | 24 + repo/system/libp11-kit.xibuild | 33 - repo/system/libp11-kit/libp11-kit.xibuild | 33 + repo/system/libpcap.xibuild | 18 - repo/system/libpcap/libpcap.xibuild | 18 + repo/system/libpipeline.xibuild | 17 - repo/system/libpipeline/libpipeline.xibuild | 17 + repo/system/libpng.xibuild | 25 - repo/system/libpng/libpng-1.6.37-apng.patch | 1728 ++++++++++++++++++++ repo/system/libpng/libpng.xibuild | 25 + repo/system/libpsl.xibuild | 21 - repo/system/libpsl/libpsl.xibuild | 21 + repo/system/libptytty.xibuild | 25 - repo/system/libptytty/libptytty.xibuild | 25 + repo/system/libqmi.xibuild | 26 - repo/system/libqmi/libqmi.xibuild | 26 + repo/system/libqrtr.xibuild | 19 - repo/system/libqrtr/libqrtr.xibuild | 19 + repo/system/libretls.xibuild | 31 - repo/system/libretls/libretls.xibuild | 31 + repo/system/libretls/test_program.c | 11 + repo/system/libsasl.xibuild | 18 - repo/system/libsasl/libsasl.xibuild | 18 + repo/system/libseccomp.xibuild | 22 - repo/system/libseccomp/libseccomp.xibuild | 22 + repo/system/libsigsegv.xibuild | 18 - repo/system/libsigsegv/libsigsegv.xibuild | 18 + repo/system/libssh2.xibuild | 20 - repo/system/libssh2/libssh2.xibuild | 20 + repo/system/libtasn1.xibuild | 18 - repo/system/libtasn1/libtasn1.xibuild | 18 + repo/system/libtermkey.xibuild | 16 - repo/system/libtermkey/libtermkey.xibuild | 16 + repo/system/libtirpc.xibuild | 28 - repo/system/libtirpc/libtirpc.xibuild | 28 + repo/system/libtool.xibuild | 23 - repo/system/libtool/libtool.xibuild | 23 + repo/system/libunistring.xibuild | 19 - repo/system/libunistring/libunistring.xibuild | 19 + repo/system/libusb.xibuild | 17 - repo/system/libusb/libusb.xibuild | 17 + repo/system/libuv.xibuild | 26 - repo/system/libuv/libuv.xibuild | 26 + repo/system/libvterm.xibuild | 17 - repo/system/libvterm/libvterm.xibuild | 17 + repo/system/libxcrypt.xibuild | 19 - repo/system/libxcrypt/libxcrypt.xibuild | 19 + repo/system/libxml2.xibuild | 20 - repo/system/libxml2/libxml2.xibuild | 20 + repo/system/libxslt.xibuild | 24 - repo/system/libxslt/libxslt.xibuild | 24 + repo/system/ljx.xibuild | 19 - repo/system/ljx/ljx.xibuild | 19 + repo/system/lua-lpeg.xibuild | 50 - repo/system/lua-lpeg/build-static-lib.patch | 29 + repo/system/lua-lpeg/lua-lpeg.xibuild | 50 + repo/system/lua-lpeg/test-fix-setlocale.patch | 20 + repo/system/lua-mpack.xibuild | 56 - repo/system/lua-mpack/dont-install-busted.patch | 13 + repo/system/lua-mpack/lua-mpack.xibuild | 56 + repo/system/lua-mpack/skip-memleak-test.patch | 20 + repo/system/lua.xibuild | 56 - repo/system/lua/lua.xibuild | 56 + repo/system/lua/lua5.4.pc | 24 + repo/system/lua5-1.xibuild | 77 - repo/system/lua5-1/lua-5.1-make.patch | 71 + repo/system/lua5-1/lua-5.1-module_paths.patch | 24 + repo/system/lua5-1/lua-5.1-readline.patch | 10 + repo/system/lua5-1/lua.pc | 32 + repo/system/lua5-1/lua5-1.xibuild | 77 + repo/system/luajit.xibuild | 32 - repo/system/luajit/luajit.xibuild | 32 + repo/system/luajit/module-paths.patch | 25 + repo/system/lz4.xibuild | 19 - repo/system/lz4/lz4.xibuild | 19 + repo/system/lzo.xibuild | 18 - repo/system/lzo/lzo.xibuild | 18 + repo/system/menu-cache.xibuild | 28 - ...ache-1.1.0-0001-Support-gcc10-compilation.patch | 108 ++ repo/system/menu-cache/menu-cache.xibuild | 28 + repo/system/mobile-broadband-provider-info.xibuild | 18 - .../mobile-broadband-provider-info.xibuild | 18 + repo/system/modemmanager.xibuild | 50 - repo/system/modemmanager/modemmanager.initd | 11 + repo/system/modemmanager/modemmanager.rules | 296 ++++ repo/system/modemmanager/modemmanager.xibuild | 50 + repo/system/mpfr.xibuild | 25 - repo/system/mpfr/mpfr.xibuild | 25 + repo/system/msgpack-c.xibuild | 20 - repo/system/msgpack-c/msgpack-c.xibuild | 20 + repo/system/mtdev.xibuild | 20 - repo/system/mtdev/mtdev.xibuild | 20 + repo/system/musl-fts.xibuild | 27 - repo/system/musl-fts/musl-fts.xibuild | 27 + repo/system/musl-legacy-compat.xibuild | 21 - .../musl-legacy-compat/musl-legacy-compat.xibuild | 21 + repo/system/musl-obstack.xibuild | 24 - repo/system/musl-obstack/musl-obstack.xibuild | 24 + repo/system/musl.xibuild | 54 - .../musl/0001-riscv64-define-ELF_NFPREG.patch | 24 + ...change-scheduler-functions-Linux-compatib.patch | 52 + repo/system/musl/fix-utmp-wtmp-paths.patch | 29 + repo/system/musl/handle-aux-at_base.patch | 46 + repo/system/musl/musl.xibuild | 54 + repo/system/musl/qsort_r.patch | 213 +++ repo/system/musl/syscall-cp-epoll.patch | 16 + repo/system/ncurses.xibuild | 40 - repo/system/ncurses/ncurses.xibuild | 40 + repo/system/nettle.xibuild | 19 - repo/system/nettle/nettle.xibuild | 19 + repo/system/networkmanager.xibuild | 66 - .../networkmanager/networkmanager-dispatcher.initd | 12 + repo/system/networkmanager/networkmanager.conf | 2 + repo/system/networkmanager/networkmanager.initd | 17 + repo/system/networkmanager/networkmanager.rules | 9 + repo/system/networkmanager/networkmanager.xibuild | 66 + repo/system/newt.xibuild | 24 - repo/system/newt/newt.xibuild | 24 + repo/system/nodejs.xibuild | 36 - .../disable-running-gyp-on-shared-deps.patch | 20 + .../nodejs/fix-build-with-system-c-ares.patch | 535 ++++++ repo/system/nodejs/nodejs.xibuild | 36 + repo/system/nspr.xibuild | 20 - repo/system/nspr/nspr.xibuild | 20 + repo/system/nss.xibuild | 73 - repo/system/nss/nss-config.in | 145 ++ repo/system/nss/nss-softokn.pc.in | 11 + repo/system/nss/nss-util.pc.in | 11 + repo/system/nss/nss.pc.in | 11 + repo/system/nss/nss.xibuild | 73 + repo/system/nsss.xibuild | 28 - repo/system/nsss/nsss.xibuild | 28 + repo/system/openntpd.xibuild | 49 - repo/system/openntpd/libtls-standalone.patch | 20 + repo/system/openntpd/ntp-user.patch | 13 + repo/system/openntpd/openntpd.confd | 3 + repo/system/openntpd/openntpd.initd | 14 + repo/system/openntpd/openntpd.xibuild | 49 + repo/system/openrc.xibuild | 139 -- ...in-mkmntdirs-in-localmount-OpenRC-service.patch | 25 + .../0002-fsck-don-t-add-C0-to-busybox-fsck.patch | 35 + ...sysinit-and-boot-as-stacked-levels-when-n.patch | 70 + ...efont-service-compatible-with-busyboxs-se.patch | 70 + ...rly-loading-of-keymap-if-kbd-is-installed.patch | 31 + ...-for-starting-services-in-a-specified-VRF.patch | 101 ++ ...aticroute-config-remove-irrelevant-parts-.patch | 47 + ...-switch-wipe_tmp-setting-to-no-by-default.patch | 44 + .../system/openrc/0009-fix-bootmisc-mv-error.patch | 27 + repo/system/openrc/0010-noexec-devfs.patch | 14 + repo/system/openrc/firstboot.initd | 34 + repo/system/openrc/hostname.initd | 18 + repo/system/openrc/hwdrivers.initd | 32 + repo/system/openrc/machine-id.initd | 17 + repo/system/openrc/modloop.confd | 6 + repo/system/openrc/modloop.initd | 153 ++ repo/system/openrc/modules.initd | 80 + repo/system/openrc/networking.initd | 88 + repo/system/openrc/openrc.logrotate | 4 + repo/system/openrc/openrc.post-install | 38 + repo/system/openrc/openrc.post-upgrade | 35 + repo/system/openrc/openrc.xibuild | 139 ++ repo/system/openrc/rc.conf | 313 ++++ repo/system/openrc/seedrng.patch | 640 ++++++++ repo/system/openrc/sysctl.initd | 87 + repo/system/openrc/sysfsconf.initd | 66 + repo/system/openrc/test-networking.sh | 65 + repo/system/openssl.xibuild | 20 - repo/system/openssl/openssl.xibuild | 20 + repo/system/pahole.xibuild | 22 - repo/system/pahole/pahole.xibuild | 22 + repo/system/pam.xibuild | 46 - repo/system/pam/other.pamd | 11 + repo/system/pam/pam.xibuild | 46 + repo/system/pam/system-account.pamd | 1 + repo/system/pam/system-auth.pamd | 2 + repo/system/pam/system-password.pamd | 3 + repo/system/pam/system-session.pamd | 3 + repo/system/pcre.xibuild | 19 - repo/system/pcre/pcre.xibuild | 19 + repo/system/pcre2.xibuild | 19 - repo/system/pcre2/pcre2.xibuild | 19 + repo/system/pcsc-lite.xibuild | 30 - repo/system/pcsc-lite/pcsc-lite.xibuild | 30 + repo/system/perl-xml-parser.xibuild | 21 - .../system/perl-xml-parser/perl-xml-parser.xibuild | 21 + repo/system/perl.xibuild | 60 - repo/system/perl/musl-locale.patch | 37 + repo/system/perl/musl-skip-dst-test.patch | 13 + repo/system/perl/musl-stack-size.patch | 16 + repo/system/perl/perl.xibuild | 60 + repo/system/perl/skip-test-due-to-busybox-ps.patch | 13 + repo/system/perl/zlib-test.patch | 80 + repo/system/polkit.xibuild | 58 - repo/system/polkit/files/polkit-1 | 9 + repo/system/polkit/patches/CVE-2021-4034.patch | 79 + .../polkit/patches/make-innetgr-optional.patch | 239 +++ repo/system/polkit/polkit.xibuild | 58 + repo/system/popt.xibuild | 17 - repo/system/popt/popt.xibuild | 17 + repo/system/psmisc.xibuild | 17 - repo/system/psmisc/psmisc.xibuild | 17 + repo/system/queue-standalone.xibuild | 15 - .../queue-standalone/queue-standalone.xibuild | 15 + repo/system/re2.xibuild | 18 - repo/system/re2/re2.xibuild | 18 + repo/system/readline.xibuild | 30 - repo/system/readline/readline.xibuild | 30 + repo/system/rtmpdump.xibuild | 28 - repo/system/rtmpdump/rtmpdump.xibuild | 28 + repo/system/sbase.xibuild | 36 - repo/system/sbase/sbase.xibuild | 36 + repo/system/sed.xibuild | 17 - repo/system/sed/sed.xibuild | 17 + repo/system/sh.xibuild | 6 - repo/system/sh/sh.xibuild | 6 + repo/system/shadow.xibuild | 136 -- repo/system/shadow/chage.pamd | 11 + repo/system/shadow/chpasswd.pamd | 12 + repo/system/shadow/login.pamd | 46 + repo/system/shadow/newusers.pamd | 12 + repo/system/shadow/passwd.pamd | 6 + repo/system/shadow/shadow.xibuild | 136 ++ repo/system/shadow/su.pamd | 27 + repo/system/shared-mime-info.xibuild | 34 - .../shared-mime-info/shared-mime-info.xibuild | 34 + repo/system/skalibs.xibuild | 22 - repo/system/skalibs/skalibs.xibuild | 22 + repo/system/slang.xibuild | 18 - repo/system/slang/slang.xibuild | 18 + repo/system/snappy.xibuild | 37 - repo/system/snappy/cmakelists.patch | 76 + repo/system/snappy/fix-inline.patch | 13 + repo/system/snappy/rtti.patch | 56 + repo/system/snappy/snappy.xibuild | 37 + repo/system/sqlite3.xibuild | 26 - repo/system/sqlite3/sqlite3.xibuild | 26 + repo/system/startup-notification.xibuild | 23 - .../startup-notification.xibuild | 23 + repo/system/sysklogd.xibuild | 38 - repo/system/sysklogd/sysklogd.initd | 3 + repo/system/sysklogd/sysklogd.xibuild | 38 + repo/system/syslinux.xibuild | 34 - .../syslinux/0018-prevent-pow-optimization.patch | 36 + repo/system/syslinux/fix-sysmacros.patch | 12 + repo/system/syslinux/gcc-10.patch | 109 ++ repo/system/syslinux/syslinux.post-upgrade | 61 + repo/system/syslinux/syslinux.trigger | 3 + repo/system/syslinux/syslinux.xibuild | 34 + repo/system/syslinux/update-extlinux | 284 ++++ repo/system/syslinux/update-extlinux.conf | 74 + repo/system/tar.xibuild | 18 - repo/system/tar/tar.xibuild | 18 + repo/system/tcl.xibuild | 54 - repo/system/tcl/tcl.xibuild | 54 + repo/system/tomlc99.xibuild | 20 - repo/system/tomlc99/tomlc99.xibuild | 20 + repo/system/tree-sitter.xibuild | 22 - repo/system/tree-sitter/tree-sitter.xibuild | 22 + repo/system/tzdata.xibuild | 56 - ...ure-the-file-offset-we-pass-to-lseek-is-o.patch | 27 + ...t-declaration-warnings-by-including-strin.patch | 28 + repo/system/tzdata/tzdata.xibuild | 56 + repo/system/ubase.xibuild | 32 - repo/system/ubase/ubase.xibuild | 32 + repo/system/udev-rules.xibuild | 14 - repo/system/udev-rules/udev-rules.xibuild | 14 + repo/system/unibilium.xibuild | 20 - repo/system/unibilium/unibilium.xibuild | 20 + repo/system/utmps.xibuild | 75 - repo/system/utmps/btmpd.initd | 24 + repo/system/utmps/btmpd.logrotate | 6 + repo/system/utmps/utmp-init.initd | 21 + repo/system/utmps/utmp-prepare.initd | 25 + repo/system/utmps/utmpd.initd | 23 + repo/system/utmps/utmps.xibuild | 75 + repo/system/utmps/wtmpd.initd | 24 + repo/system/utmps/wtmpd.logrotate | 6 + repo/system/xxhash.xibuild | 18 - repo/system/xxhash/xxhash.xibuild | 18 + repo/system/xz.xibuild | 23 - repo/system/xz/xz.xibuild | 23 + repo/system/zip.xibuild | 16 - repo/system/zip/zip.xibuild | 16 + repo/system/zlib.xibuild | 24 - repo/system/zlib/zlib.xibuild | 24 + repo/system/zstd.xibuild | 21 - repo/system/zstd/zstd.xibuild | 21 + 503 files changed, 14892 insertions(+), 5190 deletions(-) delete mode 100644 repo/system/acl.xibuild create mode 100644 repo/system/acl/acl.xibuild delete mode 100644 repo/system/acpid.xibuild create mode 100644 repo/system/acpid/acpid.confd create mode 100644 repo/system/acpid/acpid.initd create mode 100644 repo/system/acpid/acpid.xibuild create mode 100644 repo/system/acpid/anything create mode 100644 repo/system/acpid/handler.sh create mode 100644 repo/system/acpid/lid-closed create mode 100644 repo/system/acpid/power-supply-ac delete mode 100644 repo/system/argp-standalone.xibuild create mode 100644 repo/system/argp-standalone/argp-standalone.xibuild delete mode 100644 repo/system/at-spi2-atk.xibuild create mode 100644 repo/system/at-spi2-atk/at-spi2-atk.xibuild delete mode 100644 repo/system/at-spi2-core.xibuild create mode 100644 repo/system/at-spi2-core/at-spi2-core.xibuild delete mode 100644 repo/system/atk.xibuild create mode 100644 repo/system/atk/atk.xibuild delete mode 100644 repo/system/attr.xibuild create mode 100644 repo/system/attr/attr.xibuild delete mode 100644 repo/system/binutils.xibuild create mode 100644 repo/system/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch create mode 100644 repo/system/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch create mode 100644 repo/system/binutils/binutils-ld-fix-static-linking.patch create mode 100644 repo/system/binutils/binutils.xibuild create mode 100644 repo/system/binutils/defang-no-split.patch create mode 100644 repo/system/binutils/gold-mips.patch create mode 100644 repo/system/binutils/ld-bfd-mips.patch delete mode 100644 repo/system/brotli.xibuild create mode 100644 repo/system/brotli/brotli.xibuild delete mode 100644 repo/system/bzip2.xibuild create mode 100644 repo/system/bzip2/bzip2.xibuild delete mode 100644 repo/system/c-ares.xibuild create mode 100644 repo/system/c-ares/c-ares.xibuild delete mode 100644 repo/system/cacerts.xibuild create mode 100644 repo/system/cacerts/cacerts.xibuild create mode 100644 repo/system/cacerts/fix-sbase-coreutils.patch delete mode 100644 repo/system/cairo.xibuild create mode 100644 repo/system/cairo/cairo.xibuild create mode 100644 repo/system/cairo/fix-mask-usage-in-image-compositor.patch create mode 100644 repo/system/cairo/musl-stacksize.patch create mode 100644 repo/system/cairo/pdf-font-subset-Generate-valid-font-names.patch delete mode 100644 repo/system/dbus.xibuild create mode 100644 repo/system/dbus/dbus.confd create mode 100644 repo/system/dbus/dbus.initd create mode 100644 repo/system/dbus/dbus.trigger create mode 100644 repo/system/dbus/dbus.xibuild delete mode 100644 repo/system/dhcp.xibuild create mode 100644 repo/system/dhcp/01-dhclient-script-fix-bare-ip.patch create mode 100644 repo/system/dhcp/02-dhclient-script-remove-bashisms.patch create mode 100644 repo/system/dhcp/03-fix-unwind-import.patch create mode 100644 repo/system/dhcp/dhcp.xibuild create mode 100644 repo/system/dhcp/dhcpd.confd create mode 100644 repo/system/dhcp/dhcpd.initd delete mode 100644 repo/system/efibootmgr.xibuild create mode 100644 repo/system/efibootmgr/efibootmgr.xibuild delete mode 100644 repo/system/efivar.xibuild create mode 100644 repo/system/efivar/efivar.xibuild create mode 100644 repo/system/efivar/patches/efivar-fix-format_guid.patch create mode 100644 repo/system/efivar/patches/efivar-fix-packed.patch create mode 100644 repo/system/efivar/patches/efivar-fix-ucs2.patch create mode 100644 repo/system/efivar/patches/musl-bswap.patch delete mode 100644 repo/system/elfutils.xibuild create mode 100644 repo/system/elfutils/elfutils.xibuild create mode 100644 repo/system/elfutils/files/error.h create mode 100644 repo/system/elfutils/patches/fix-aarch64_fregs.patch create mode 100644 repo/system/elfutils/patches/fix-uninitialized.patch create mode 100644 repo/system/elfutils/patches/musl-asm-ptrace-h.patch create mode 100644 repo/system/elfutils/patches/musl-macros.patch create mode 100644 repo/system/elfutils/patches/musl-strndupa.patch delete mode 100644 repo/system/elogind.xibuild create mode 100644 repo/system/elogind/elogind.initd create mode 100644 repo/system/elogind/elogind.xibuild create mode 100644 repo/system/elogind/id-nobody.patch create mode 100644 repo/system/elogind/mips.patch create mode 100644 repo/system/elogind/ppc64-bad-tuple.patch create mode 100644 repo/system/elogind/ppcle.patch delete mode 100644 repo/system/eudev.xibuild create mode 100644 repo/system/eudev/default-rules.patch create mode 100644 repo/system/eudev/eudev.xibuild create mode 100644 repo/system/eudev/load-fbcon.patch create mode 100644 repo/system/eudev/udev.initd create mode 100644 repo/system/eudev/udev_retry.initd delete mode 100644 repo/system/execline.xibuild create mode 100644 repo/system/execline/execline.xibuild delete mode 100644 repo/system/expat.xibuild create mode 100644 repo/system/expat/expat.xibuild delete mode 100644 repo/system/findutils.xibuild create mode 100644 repo/system/findutils/findutils.xibuild delete mode 100644 repo/system/freetype2.xibuild create mode 100644 repo/system/freetype2/freetype2.xibuild delete mode 100644 repo/system/fribidi.xibuild create mode 100644 repo/system/fribidi/fribidi.xibuild delete mode 100644 repo/system/gc.xibuild create mode 100644 repo/system/gc/gc.xibuild delete mode 100644 repo/system/gdbm.xibuild create mode 100644 repo/system/gdbm/gdbm.xibuild delete mode 100644 repo/system/gettext.xibuild create mode 100644 repo/system/gettext/gettext.xibuild delete mode 100644 repo/system/glew.xibuild create mode 100644 repo/system/glew/glew.patch create mode 100644 repo/system/glew/glew.xibuild delete mode 100644 repo/system/glib.xibuild create mode 100644 repo/system/glib/0001-gquark-fix-initialization-with-c-constructors.patch create mode 100644 repo/system/glib/deprecated-no-warn.patch create mode 100644 repo/system/glib/glib.xibuild create mode 100644 repo/system/glib/musl-libintl.patch delete mode 100644 repo/system/glm.xibuild create mode 100644 repo/system/glm/fix-endian-test.patch create mode 100644 repo/system/glm/glm.pc create mode 100644 repo/system/glm/glm.xibuild delete mode 100644 repo/system/glu.xibuild create mode 100644 repo/system/glu/glu.xibuild delete mode 100644 repo/system/gmp.xibuild create mode 100644 repo/system/gmp/gmp.xibuild delete mode 100644 repo/system/gnutls.xibuild create mode 100644 repo/system/gnutls/gnutls.xibuild delete mode 100644 repo/system/gobject-introspection.xibuild create mode 100644 repo/system/gobject-introspection/gobject-introspection.xibuild create mode 100644 repo/system/gobject-introspection/musl-time64.patch delete mode 100644 repo/system/gperf.xibuild create mode 100644 repo/system/gperf/gperf.xibuild delete mode 100644 repo/system/grub.xibuild create mode 100644 repo/system/grub/grub.xibuild delete mode 100644 repo/system/guile.xibuild create mode 100644 repo/system/guile/guile.xibuild delete mode 100644 repo/system/gzip.xibuild create mode 100644 repo/system/gzip/gzip.xibuild delete mode 100644 repo/system/hwids.xibuild create mode 100644 repo/system/hwids/hwids.xibuild delete mode 100644 repo/system/iana-etc.xibuild create mode 100644 repo/system/iana-etc/iana-etc.xibuild delete mode 100644 repo/system/icu.xibuild create mode 100644 repo/system/icu/fix-ucptrietest-golden-diff.patch create mode 100644 repo/system/icu/icu.xibuild delete mode 100644 repo/system/imlib2.xibuild create mode 100644 repo/system/imlib2/imlib2.xibuild delete mode 100644 repo/system/intltool.xibuild create mode 100644 repo/system/intltool/intltool.xibuild delete mode 100644 repo/system/jansson.xibuild create mode 100644 repo/system/jansson/jansson.xibuild delete mode 100644 repo/system/js78.xibuild create mode 100644 repo/system/js78/js78.xibuild create mode 100644 repo/system/js78/patches/disable-jslint.patch create mode 100644 repo/system/js78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch create mode 100644 repo/system/js78/patches/fix-musl-build.patch create mode 100644 repo/system/js78/patches/fix-python3.10-compilation.patch create mode 100644 repo/system/js78/patches/fix-rust-target.patch delete mode 100644 repo/system/json-c.xibuild create mode 100644 repo/system/json-c/json-c.xibuild delete mode 100644 repo/system/json-glib.xibuild create mode 100644 repo/system/json-glib/json-glib.xibuild delete mode 100644 repo/system/jsoncpp.xibuild create mode 100644 repo/system/jsoncpp/jsoncpp.xibuild delete mode 100644 repo/system/kbd.xibuild create mode 100644 repo/system/kbd/kbd.xibuild delete mode 100644 repo/system/kmod.xibuild create mode 100644 repo/system/kmod/kmod.xibuild delete mode 100644 repo/system/krb5.xibuild create mode 100644 repo/system/krb5/krb5.xibuild delete mode 100644 repo/system/lcms2.xibuild create mode 100644 repo/system/lcms2/lcms2.xibuild delete mode 100644 repo/system/ldns.xibuild create mode 100644 repo/system/ldns/ldns.xibuild delete mode 100644 repo/system/libarchive.xibuild create mode 100644 repo/system/libarchive/libarchive.xibuild delete mode 100644 repo/system/libcap-ng.xibuild create mode 100644 repo/system/libcap-ng/libcap-ng.xibuild delete mode 100644 repo/system/libcap.xibuild create mode 100644 repo/system/libcap/libcap.xibuild delete mode 100644 repo/system/libconfig.xibuild create mode 100644 repo/system/libconfig/libconfig.xibuild delete mode 100644 repo/system/libdwarf.xibuild create mode 100644 repo/system/libdwarf/libdwarf.xibuild delete mode 100644 repo/system/libedit.xibuild create mode 100644 repo/system/libedit/libedit.xibuild delete mode 100644 repo/system/libelf.xibuild create mode 100644 repo/system/libelf/libelf.xibuild delete mode 100644 repo/system/libev.xibuild create mode 100644 repo/system/libev/libev-4.11-Add-pkgconfig-support.patch create mode 100644 repo/system/libev/libev.xibuild delete mode 100644 repo/system/libevent.xibuild create mode 100644 repo/system/libevent/libevent.xibuild delete mode 100644 repo/system/libexif.xibuild create mode 100644 repo/system/libexif/libexif.xibuild delete mode 100644 repo/system/libffi.xibuild create mode 100644 repo/system/libffi/libffi.xibuild delete mode 100644 repo/system/libfm-extra.xibuild create mode 100644 repo/system/libfm-extra/libfm-extra.xibuild delete mode 100644 repo/system/libfm.xibuild create mode 100644 repo/system/libfm/libfm.xibuild delete mode 100644 repo/system/libgcrypt.xibuild create mode 100644 repo/system/libgcrypt/libgcrypt.xibuild delete mode 100644 repo/system/libgpg-error.xibuild create mode 100644 repo/system/libgpg-error/libgpg-error.xibuild delete mode 100644 repo/system/libgudev.xibuild create mode 100644 repo/system/libgudev/libgudev.xibuild delete mode 100644 repo/system/libidn.xibuild create mode 100644 repo/system/libidn/libidn.xibuild delete mode 100644 repo/system/libldap.xibuild create mode 100644 repo/system/libldap/libldap.xibuild delete mode 100644 repo/system/liblinear.xibuild create mode 100644 repo/system/liblinear/liblinear.xibuild delete mode 100644 repo/system/libluv.xibuild create mode 100644 repo/system/libluv/libluv.xibuild delete mode 100644 repo/system/libmbim.xibuild create mode 100644 repo/system/libmbim/libmbim.xibuild delete mode 100644 repo/system/libmpack.xibuild create mode 100644 repo/system/libmpack/libmpack.xibuild delete mode 100644 repo/system/libndp.xibuild create mode 100644 repo/system/libndp/libndp.xibuild delete mode 100644 repo/system/libnghttp.xibuild create mode 100644 repo/system/libnghttp/libnghttp.xibuild delete mode 100644 repo/system/libnl.xibuild create mode 100644 repo/system/libnl/libnl.xibuild delete mode 100644 repo/system/libnsl.xibuild create mode 100644 repo/system/libnsl/libnsl.xibuild delete mode 100644 repo/system/libp11-kit.xibuild create mode 100644 repo/system/libp11-kit/libp11-kit.xibuild delete mode 100644 repo/system/libpcap.xibuild create mode 100644 repo/system/libpcap/libpcap.xibuild delete mode 100644 repo/system/libpipeline.xibuild create mode 100644 repo/system/libpipeline/libpipeline.xibuild delete mode 100644 repo/system/libpng.xibuild create mode 100644 repo/system/libpng/libpng-1.6.37-apng.patch create mode 100644 repo/system/libpng/libpng.xibuild delete mode 100644 repo/system/libpsl.xibuild create mode 100644 repo/system/libpsl/libpsl.xibuild delete mode 100644 repo/system/libptytty.xibuild create mode 100644 repo/system/libptytty/libptytty.xibuild delete mode 100644 repo/system/libqmi.xibuild create mode 100644 repo/system/libqmi/libqmi.xibuild delete mode 100644 repo/system/libqrtr.xibuild create mode 100644 repo/system/libqrtr/libqrtr.xibuild delete mode 100644 repo/system/libretls.xibuild create mode 100644 repo/system/libretls/libretls.xibuild create mode 100644 repo/system/libretls/test_program.c delete mode 100644 repo/system/libsasl.xibuild create mode 100644 repo/system/libsasl/libsasl.xibuild delete mode 100644 repo/system/libseccomp.xibuild create mode 100644 repo/system/libseccomp/libseccomp.xibuild delete mode 100644 repo/system/libsigsegv.xibuild create mode 100644 repo/system/libsigsegv/libsigsegv.xibuild delete mode 100644 repo/system/libssh2.xibuild create mode 100644 repo/system/libssh2/libssh2.xibuild delete mode 100644 repo/system/libtasn1.xibuild create mode 100644 repo/system/libtasn1/libtasn1.xibuild delete mode 100644 repo/system/libtermkey.xibuild create mode 100644 repo/system/libtermkey/libtermkey.xibuild delete mode 100644 repo/system/libtirpc.xibuild create mode 100644 repo/system/libtirpc/libtirpc.xibuild delete mode 100644 repo/system/libtool.xibuild create mode 100644 repo/system/libtool/libtool.xibuild delete mode 100644 repo/system/libunistring.xibuild create mode 100644 repo/system/libunistring/libunistring.xibuild delete mode 100644 repo/system/libusb.xibuild create mode 100644 repo/system/libusb/libusb.xibuild delete mode 100644 repo/system/libuv.xibuild create mode 100644 repo/system/libuv/libuv.xibuild delete mode 100644 repo/system/libvterm.xibuild create mode 100644 repo/system/libvterm/libvterm.xibuild delete mode 100644 repo/system/libxcrypt.xibuild create mode 100644 repo/system/libxcrypt/libxcrypt.xibuild delete mode 100644 repo/system/libxml2.xibuild create mode 100644 repo/system/libxml2/libxml2.xibuild delete mode 100644 repo/system/libxslt.xibuild create mode 100644 repo/system/libxslt/libxslt.xibuild delete mode 100644 repo/system/ljx.xibuild create mode 100644 repo/system/ljx/ljx.xibuild delete mode 100644 repo/system/lua-lpeg.xibuild create mode 100644 repo/system/lua-lpeg/build-static-lib.patch create mode 100644 repo/system/lua-lpeg/lua-lpeg.xibuild create mode 100644 repo/system/lua-lpeg/test-fix-setlocale.patch delete mode 100644 repo/system/lua-mpack.xibuild create mode 100644 repo/system/lua-mpack/dont-install-busted.patch create mode 100644 repo/system/lua-mpack/lua-mpack.xibuild create mode 100644 repo/system/lua-mpack/skip-memleak-test.patch delete mode 100644 repo/system/lua.xibuild create mode 100644 repo/system/lua/lua.xibuild create mode 100644 repo/system/lua/lua5.4.pc delete mode 100644 repo/system/lua5-1.xibuild create mode 100644 repo/system/lua5-1/lua-5.1-make.patch create mode 100644 repo/system/lua5-1/lua-5.1-module_paths.patch create mode 100644 repo/system/lua5-1/lua-5.1-readline.patch create mode 100644 repo/system/lua5-1/lua.pc create mode 100644 repo/system/lua5-1/lua5-1.xibuild delete mode 100644 repo/system/luajit.xibuild create mode 100644 repo/system/luajit/luajit.xibuild create mode 100644 repo/system/luajit/module-paths.patch delete mode 100644 repo/system/lz4.xibuild create mode 100644 repo/system/lz4/lz4.xibuild delete mode 100644 repo/system/lzo.xibuild create mode 100644 repo/system/lzo/lzo.xibuild delete mode 100644 repo/system/menu-cache.xibuild create mode 100644 repo/system/menu-cache/menu-cache-1.1.0-0001-Support-gcc10-compilation.patch create mode 100644 repo/system/menu-cache/menu-cache.xibuild delete mode 100644 repo/system/mobile-broadband-provider-info.xibuild create mode 100644 repo/system/mobile-broadband-provider-info/mobile-broadband-provider-info.xibuild delete mode 100644 repo/system/modemmanager.xibuild create mode 100644 repo/system/modemmanager/modemmanager.initd create mode 100644 repo/system/modemmanager/modemmanager.rules create mode 100644 repo/system/modemmanager/modemmanager.xibuild delete mode 100644 repo/system/mpfr.xibuild create mode 100644 repo/system/mpfr/mpfr.xibuild delete mode 100644 repo/system/msgpack-c.xibuild create mode 100644 repo/system/msgpack-c/msgpack-c.xibuild delete mode 100644 repo/system/mtdev.xibuild create mode 100644 repo/system/mtdev/mtdev.xibuild delete mode 100644 repo/system/musl-fts.xibuild create mode 100644 repo/system/musl-fts/musl-fts.xibuild delete mode 100644 repo/system/musl-legacy-compat.xibuild create mode 100644 repo/system/musl-legacy-compat/musl-legacy-compat.xibuild delete mode 100644 repo/system/musl-obstack.xibuild create mode 100644 repo/system/musl-obstack/musl-obstack.xibuild delete mode 100644 repo/system/musl.xibuild create mode 100644 repo/system/musl/0001-riscv64-define-ELF_NFPREG.patch create mode 100644 repo/system/musl/change-scheduler-functions-Linux-compatib.patch create mode 100644 repo/system/musl/fix-utmp-wtmp-paths.patch create mode 100644 repo/system/musl/handle-aux-at_base.patch create mode 100644 repo/system/musl/musl.xibuild create mode 100644 repo/system/musl/qsort_r.patch create mode 100644 repo/system/musl/syscall-cp-epoll.patch delete mode 100644 repo/system/ncurses.xibuild create mode 100644 repo/system/ncurses/ncurses.xibuild delete mode 100644 repo/system/nettle.xibuild create mode 100644 repo/system/nettle/nettle.xibuild delete mode 100644 repo/system/networkmanager.xibuild create mode 100644 repo/system/networkmanager/networkmanager-dispatcher.initd create mode 100644 repo/system/networkmanager/networkmanager.conf create mode 100644 repo/system/networkmanager/networkmanager.initd create mode 100644 repo/system/networkmanager/networkmanager.rules create mode 100644 repo/system/networkmanager/networkmanager.xibuild delete mode 100644 repo/system/newt.xibuild create mode 100644 repo/system/newt/newt.xibuild delete mode 100644 repo/system/nodejs.xibuild create mode 100644 repo/system/nodejs/disable-running-gyp-on-shared-deps.patch create mode 100644 repo/system/nodejs/fix-build-with-system-c-ares.patch create mode 100644 repo/system/nodejs/nodejs.xibuild delete mode 100644 repo/system/nspr.xibuild create mode 100644 repo/system/nspr/nspr.xibuild delete mode 100644 repo/system/nss.xibuild create mode 100644 repo/system/nss/nss-config.in create mode 100644 repo/system/nss/nss-softokn.pc.in create mode 100644 repo/system/nss/nss-util.pc.in create mode 100644 repo/system/nss/nss.pc.in create mode 100644 repo/system/nss/nss.xibuild delete mode 100644 repo/system/nsss.xibuild create mode 100644 repo/system/nsss/nsss.xibuild delete mode 100644 repo/system/openntpd.xibuild create mode 100644 repo/system/openntpd/libtls-standalone.patch create mode 100644 repo/system/openntpd/ntp-user.patch create mode 100644 repo/system/openntpd/openntpd.confd create mode 100644 repo/system/openntpd/openntpd.initd create mode 100644 repo/system/openntpd/openntpd.xibuild delete mode 100644 repo/system/openrc.xibuild create mode 100644 repo/system/openrc/0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch create mode 100644 repo/system/openrc/0002-fsck-don-t-add-C0-to-busybox-fsck.patch create mode 100644 repo/system/openrc/0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch create mode 100644 repo/system/openrc/0004-make-consolefont-service-compatible-with-busyboxs-se.patch create mode 100644 repo/system/openrc/0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch create mode 100644 repo/system/openrc/0006-Add-support-for-starting-services-in-a-specified-VRF.patch create mode 100644 repo/system/openrc/0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch create mode 100644 repo/system/openrc/0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch create mode 100644 repo/system/openrc/0009-fix-bootmisc-mv-error.patch create mode 100644 repo/system/openrc/0010-noexec-devfs.patch create mode 100644 repo/system/openrc/firstboot.initd create mode 100644 repo/system/openrc/hostname.initd create mode 100644 repo/system/openrc/hwdrivers.initd create mode 100644 repo/system/openrc/machine-id.initd create mode 100644 repo/system/openrc/modloop.confd create mode 100755 repo/system/openrc/modloop.initd create mode 100644 repo/system/openrc/modules.initd create mode 100644 repo/system/openrc/networking.initd create mode 100644 repo/system/openrc/openrc.logrotate create mode 100644 repo/system/openrc/openrc.post-install create mode 100644 repo/system/openrc/openrc.post-upgrade create mode 100644 repo/system/openrc/openrc.xibuild create mode 100644 repo/system/openrc/rc.conf create mode 100644 repo/system/openrc/seedrng.patch create mode 100644 repo/system/openrc/sysctl.initd create mode 100644 repo/system/openrc/sysfsconf.initd create mode 100644 repo/system/openrc/test-networking.sh delete mode 100644 repo/system/openssl.xibuild create mode 100644 repo/system/openssl/openssl.xibuild delete mode 100644 repo/system/pahole.xibuild create mode 100644 repo/system/pahole/pahole.xibuild delete mode 100644 repo/system/pam.xibuild create mode 100644 repo/system/pam/other.pamd create mode 100644 repo/system/pam/pam.xibuild create mode 100644 repo/system/pam/system-account.pamd create mode 100644 repo/system/pam/system-auth.pamd create mode 100644 repo/system/pam/system-password.pamd create mode 100644 repo/system/pam/system-session.pamd delete mode 100644 repo/system/pcre.xibuild create mode 100644 repo/system/pcre/pcre.xibuild delete mode 100644 repo/system/pcre2.xibuild create mode 100644 repo/system/pcre2/pcre2.xibuild delete mode 100644 repo/system/pcsc-lite.xibuild create mode 100644 repo/system/pcsc-lite/pcsc-lite.xibuild delete mode 100644 repo/system/perl-xml-parser.xibuild create mode 100644 repo/system/perl-xml-parser/perl-xml-parser.xibuild delete mode 100644 repo/system/perl.xibuild create mode 100644 repo/system/perl/musl-locale.patch create mode 100644 repo/system/perl/musl-skip-dst-test.patch create mode 100644 repo/system/perl/musl-stack-size.patch create mode 100644 repo/system/perl/perl.xibuild create mode 100644 repo/system/perl/skip-test-due-to-busybox-ps.patch create mode 100644 repo/system/perl/zlib-test.patch delete mode 100644 repo/system/polkit.xibuild create mode 100644 repo/system/polkit/files/polkit-1 create mode 100644 repo/system/polkit/patches/CVE-2021-4034.patch create mode 100644 repo/system/polkit/patches/make-innetgr-optional.patch create mode 100644 repo/system/polkit/polkit.xibuild delete mode 100644 repo/system/popt.xibuild create mode 100644 repo/system/popt/popt.xibuild delete mode 100644 repo/system/psmisc.xibuild create mode 100644 repo/system/psmisc/psmisc.xibuild delete mode 100644 repo/system/queue-standalone.xibuild create mode 100644 repo/system/queue-standalone/queue-standalone.xibuild delete mode 100644 repo/system/re2.xibuild create mode 100644 repo/system/re2/re2.xibuild delete mode 100644 repo/system/readline.xibuild create mode 100644 repo/system/readline/readline.xibuild delete mode 100644 repo/system/rtmpdump.xibuild create mode 100644 repo/system/rtmpdump/rtmpdump.xibuild delete mode 100644 repo/system/sbase.xibuild create mode 100644 repo/system/sbase/sbase.xibuild delete mode 100644 repo/system/sed.xibuild create mode 100644 repo/system/sed/sed.xibuild delete mode 100644 repo/system/sh.xibuild create mode 100644 repo/system/sh/sh.xibuild delete mode 100644 repo/system/shadow.xibuild create mode 100644 repo/system/shadow/chage.pamd create mode 100644 repo/system/shadow/chpasswd.pamd create mode 100644 repo/system/shadow/login.pamd create mode 100644 repo/system/shadow/newusers.pamd create mode 100644 repo/system/shadow/passwd.pamd create mode 100644 repo/system/shadow/shadow.xibuild create mode 100644 repo/system/shadow/su.pamd delete mode 100644 repo/system/shared-mime-info.xibuild create mode 100644 repo/system/shared-mime-info/shared-mime-info.xibuild delete mode 100644 repo/system/skalibs.xibuild create mode 100644 repo/system/skalibs/skalibs.xibuild delete mode 100644 repo/system/slang.xibuild create mode 100644 repo/system/slang/slang.xibuild delete mode 100644 repo/system/snappy.xibuild create mode 100644 repo/system/snappy/cmakelists.patch create mode 100644 repo/system/snappy/fix-inline.patch create mode 100644 repo/system/snappy/rtti.patch create mode 100644 repo/system/snappy/snappy.xibuild delete mode 100644 repo/system/sqlite3.xibuild create mode 100644 repo/system/sqlite3/sqlite3.xibuild delete mode 100644 repo/system/startup-notification.xibuild create mode 100644 repo/system/startup-notification/startup-notification.xibuild delete mode 100644 repo/system/sysklogd.xibuild create mode 100644 repo/system/sysklogd/sysklogd.initd create mode 100644 repo/system/sysklogd/sysklogd.xibuild delete mode 100644 repo/system/syslinux.xibuild create mode 100644 repo/system/syslinux/0018-prevent-pow-optimization.patch create mode 100644 repo/system/syslinux/fix-sysmacros.patch create mode 100644 repo/system/syslinux/gcc-10.patch create mode 100644 repo/system/syslinux/syslinux.post-upgrade create mode 100644 repo/system/syslinux/syslinux.trigger create mode 100644 repo/system/syslinux/syslinux.xibuild create mode 100644 repo/system/syslinux/update-extlinux create mode 100644 repo/system/syslinux/update-extlinux.conf delete mode 100644 repo/system/tar.xibuild create mode 100644 repo/system/tar/tar.xibuild delete mode 100644 repo/system/tcl.xibuild create mode 100644 repo/system/tcl/tcl.xibuild delete mode 100644 repo/system/tomlc99.xibuild create mode 100644 repo/system/tomlc99/tomlc99.xibuild delete mode 100644 repo/system/tree-sitter.xibuild create mode 100644 repo/system/tree-sitter/tree-sitter.xibuild delete mode 100644 repo/system/tzdata.xibuild create mode 100644 repo/system/tzdata/0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch create mode 100644 repo/system/tzdata/0002-fix-implicit-declaration-warnings-by-including-strin.patch create mode 100644 repo/system/tzdata/tzdata.xibuild delete mode 100644 repo/system/ubase.xibuild create mode 100644 repo/system/ubase/ubase.xibuild delete mode 100644 repo/system/udev-rules.xibuild create mode 100644 repo/system/udev-rules/udev-rules.xibuild delete mode 100644 repo/system/unibilium.xibuild create mode 100644 repo/system/unibilium/unibilium.xibuild delete mode 100644 repo/system/utmps.xibuild create mode 100644 repo/system/utmps/btmpd.initd create mode 100644 repo/system/utmps/btmpd.logrotate create mode 100644 repo/system/utmps/utmp-init.initd create mode 100644 repo/system/utmps/utmp-prepare.initd create mode 100644 repo/system/utmps/utmpd.initd create mode 100644 repo/system/utmps/utmps.xibuild create mode 100644 repo/system/utmps/wtmpd.initd create mode 100644 repo/system/utmps/wtmpd.logrotate delete mode 100644 repo/system/xxhash.xibuild create mode 100644 repo/system/xxhash/xxhash.xibuild delete mode 100644 repo/system/xz.xibuild create mode 100644 repo/system/xz/xz.xibuild delete mode 100644 repo/system/zip.xibuild create mode 100644 repo/system/zip/zip.xibuild delete mode 100644 repo/system/zlib.xibuild create mode 100644 repo/system/zlib/zlib.xibuild delete mode 100644 repo/system/zstd.xibuild create mode 100644 repo/system/zstd/zstd.xibuild (limited to 'repo/system') diff --git a/repo/system/acl.xibuild b/repo/system/acl.xibuild deleted file mode 100644 index eca7ca5..0000000 --- a/repo/system/acl.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="attr" - -PKG_VER=2.3.1 -SOURCE=http://download.savannah.nongnu.org/releases/acl/acl-$PKG_VER.tar.xz -DESC="Access control list utilities, libraries and headers" - -build () { - ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/acl-$PKG_VER - make -} - -package() { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/acl/acl.xibuild b/repo/system/acl/acl.xibuild new file mode 100644 index 0000000..eca7ca5 --- /dev/null +++ b/repo/system/acl/acl.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="attr" + +PKG_VER=2.3.1 +SOURCE=http://download.savannah.nongnu.org/releases/acl/acl-$PKG_VER.tar.xz +DESC="Access control list utilities, libraries and headers" + +build () { + ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/acl-$PKG_VER + make +} + +package() { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/acpid.xibuild b/repo/system/acpid.xibuild deleted file mode 100644 index f960ac0..0000000 --- a/repo/system/acpid.xibuild +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl" - -PKG_VER=2.0.33 -SOURCE=https://downloads.sourceforge.net/acpid2/acpid-$PKG_VER.tar.xz -DESC="Daemon for battery, power, and thermal readings" - -ADDITIONAL=" - acpid.confd - acpid.initd - anything - handler.sh - lid-closed - power-supply-ac -" -build () { - ./configure --prefix=/usr \ - --docdir=/usr/share/doc/acpid-$PKG_VER && - make -} - -package () { - make DESTDIR=$PKG_DEST install - install -m755 -d $PKG_DEST/etc/acpi/events && - cp -r samples $PKG_DEST/usr/share/doc/acpid-$PKG_VER - - install -D -m 755 handler.sh etc/acpi/handler.sh - install -D -m 644 anything etc/acpi/events/anything - install -D -m 755 power-supply-ac usr/share/acpid/ - install -D -m 755 lid-closed usr/share/acpid/ - - install -D -m 755 acpid.initd etc/init.d/acpid - install -D -m 644 acpid.confd etc/conf.d/acpid - -} diff --git a/repo/system/acpid/acpid.confd b/repo/system/acpid/acpid.confd new file mode 100644 index 0000000..2b3d304 --- /dev/null +++ b/repo/system/acpid/acpid.confd @@ -0,0 +1,7 @@ +# Configuration file for /etc/init.d/acpid (from acpid package) + +# Additional arguments to pass to acpid. +command_args="--logevents" + +# Uncomment to use process supervisor. +#supervisor="supervise-daemon" diff --git a/repo/system/acpid/acpid.initd b/repo/system/acpid/acpid.initd new file mode 100644 index 0000000..c2d60f9 --- /dev/null +++ b/repo/system/acpid/acpid.initd @@ -0,0 +1,28 @@ +#!/sbin/openrc-run + +description="The ACPI Daemon" + +extra_started_commands="reload" +description_reload="Reload configuration" + +command="/sbin/acpid" +command_args="--foreground ${command_args:-}" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +depend() { + need dev localmount + after hwdrivers modules + provide acpid + keyword -vserver -lxc +} + +reload() { + ebegin "Reloading $RC_SVCNAME configuration" + if [ "$supervisor" ]; then + $supervisor "$RC_SVCNAME" --signal HUP + else + start-stop-daemon --pidfile "$pidfile" --signal HUP + fi + eend $? +} diff --git a/repo/system/acpid/acpid.xibuild b/repo/system/acpid/acpid.xibuild new file mode 100644 index 0000000..f960ac0 --- /dev/null +++ b/repo/system/acpid/acpid.xibuild @@ -0,0 +1,37 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=2.0.33 +SOURCE=https://downloads.sourceforge.net/acpid2/acpid-$PKG_VER.tar.xz +DESC="Daemon for battery, power, and thermal readings" + +ADDITIONAL=" + acpid.confd + acpid.initd + anything + handler.sh + lid-closed + power-supply-ac +" +build () { + ./configure --prefix=/usr \ + --docdir=/usr/share/doc/acpid-$PKG_VER && + make +} + +package () { + make DESTDIR=$PKG_DEST install + install -m755 -d $PKG_DEST/etc/acpi/events && + cp -r samples $PKG_DEST/usr/share/doc/acpid-$PKG_VER + + install -D -m 755 handler.sh etc/acpi/handler.sh + install -D -m 644 anything etc/acpi/events/anything + install -D -m 755 power-supply-ac usr/share/acpid/ + install -D -m 755 lid-closed usr/share/acpid/ + + install -D -m 755 acpid.initd etc/init.d/acpid + install -D -m 644 acpid.confd etc/conf.d/acpid + +} diff --git a/repo/system/acpid/anything b/repo/system/acpid/anything new file mode 100644 index 0000000..d182898 --- /dev/null +++ b/repo/system/acpid/anything @@ -0,0 +1,3 @@ +# Pass all events to our one handler script +event=.* +action=/etc/acpi/handler.sh %e diff --git a/repo/system/acpid/handler.sh b/repo/system/acpid/handler.sh new file mode 100644 index 0000000..412ac02 --- /dev/null +++ b/repo/system/acpid/handler.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# vim: set ts=4: +# +# This is the default ACPI handler script that is configured in +# /etc/acpi/events/anything to be called for every ACPI event. +# You can edit it and add your own actions; treat it as a configuration file. +# +PATH="/usr/share/acpid:$PATH" +alias log='logger -t acpid' + +# ::: +case "$1:$2:$3:$4" in + +button/power:PWRF:*) + log 'Power button pressed' + # Shutdown the system unless it has a lid (notebook). + [ -e /proc/acpi/button/lid/LID ] || poweroff +;; +button/sleep:SLPB:*) + log 'Sleep button pressed' + # Suspend to RAM. + zzz +;; +button/lid:*:close:*) + log 'Lid closed' + # Suspend to RAM if AC adapter is not connected. + power-supply-ac || zzz +;; +ac_adapter:*:*:*0) + log 'AC adapter unplugged' + # Suspend to RAM if notebook's lid is closed. + lid-closed && zzz +;; +esac + +exit 0 diff --git a/repo/system/acpid/lid-closed b/repo/system/acpid/lid-closed new file mode 100644 index 0000000..57ffb71 --- /dev/null +++ b/repo/system/acpid/lid-closed @@ -0,0 +1,21 @@ +#!/bin/sh +# This script exits with status 0 if the latop's lid is closed, 1 if opened, +# 10 if /proc/acpi/button/lid/LID/state does not exist or is not readable. +set -u + +STATE_FILE='/proc/acpi/button/lid/LID/state' + +verbose=false +[ "${1:-}" = '-v' ] && verbose=true + +if ! [ -r "$STATE_FILE" ]; then + $verbose && echo "$STATE_FILE does not exist or is not readable!" >&2 + exit 10 +fi + +read -r _ state < "$STATE_FILE" || exit 10 + +[ "$state" = 'closed' ]; rc=$? + +$verbose && echo $rc +exit $rc diff --git a/repo/system/acpid/power-supply-ac b/repo/system/acpid/power-supply-ac new file mode 100644 index 0000000..337aae2 --- /dev/null +++ b/repo/system/acpid/power-supply-ac @@ -0,0 +1,25 @@ +#!/bin/sh +# This script exits with status 0 when the computer is on AC power (or no AC +# power supply found), 1 otherwise (i.e. running on battery). +set -u + +verbose=false +[ "${1:-}" = '-v' ] && verbose=true + +# If we do not have any power supplies, assume we are on AC. +rc=0 + +# Iterate through power supplies sysfs knows about. +for ps in /sys/class/power_supply/*; do + [ -r $ps/online ] || continue + # We know we have an AC adaptor, our default return changes to failed. + rc=1 + + if [ "$(cat $ps/online)" -eq 1 ]; then + rc=0 + break + fi +done + +$verbose && echo $rc +exit $rc diff --git a/repo/system/argp-standalone.xibuild b/repo/system/argp-standalone.xibuild deleted file mode 100644 index 4c2a722..0000000 --- a/repo/system/argp-standalone.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="" -DEPS="musl" - -PKG_VER=1.3 -SOURCE=https://www.lysator.liu.se/~nisse/misc/argp-standalone-$PKG_VER.tar.gz - -DESC="Standalone implementation for the argp interface" - -build () { - CFLAGS=" -fPIC" ./configure \ - --prefix=/usr \ - --disable-static \ - --sysconfdir=/etc \ - --localstatedir=/var && - make -} - -package () { - install -d $PKG_DEST/usr/lib - install -d $PKG_DEST/usr/include - cp libargp.a $PKG_DEST/usr/lib/ - cp argp.h $PKG_DEST/usr/include/ -} - diff --git a/repo/system/argp-standalone/argp-standalone.xibuild b/repo/system/argp-standalone/argp-standalone.xibuild new file mode 100644 index 0000000..4c2a722 --- /dev/null +++ b/repo/system/argp-standalone/argp-standalone.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="musl" + +PKG_VER=1.3 +SOURCE=https://www.lysator.liu.se/~nisse/misc/argp-standalone-$PKG_VER.tar.gz + +DESC="Standalone implementation for the argp interface" + +build () { + CFLAGS=" -fPIC" ./configure \ + --prefix=/usr \ + --disable-static \ + --sysconfdir=/etc \ + --localstatedir=/var && + make +} + +package () { + install -d $PKG_DEST/usr/lib + install -d $PKG_DEST/usr/include + cp libargp.a $PKG_DEST/usr/lib/ + cp argp.h $PKG_DEST/usr/include/ +} + diff --git a/repo/system/at-spi2-atk.xibuild b/repo/system/at-spi2-atk.xibuild deleted file mode 100644 index 9cdecd9..0000000 --- a/repo/system/at-spi2-atk.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -NAME="at-spi2-atk" -DESC="A GTK+ module that bridges ATK to D-Bus at-spi" - -MAKEDEPS="meson ninja " -DEPS="at-spi2-core atk dbus glib " - -PKG_VER=2.38.0 -SOURCE="https://download.gnome.org/sources/at-spi2-atk/${PKG_VER%.*}/at-spi2-atk-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/at-spi2-atk/at-spi2-atk.xibuild b/repo/system/at-spi2-atk/at-spi2-atk.xibuild new file mode 100644 index 0000000..9cdecd9 --- /dev/null +++ b/repo/system/at-spi2-atk/at-spi2-atk.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="at-spi2-atk" +DESC="A GTK+ module that bridges ATK to D-Bus at-spi" + +MAKEDEPS="meson ninja " +DEPS="at-spi2-core atk dbus glib " + +PKG_VER=2.38.0 +SOURCE="https://download.gnome.org/sources/at-spi2-atk/${PKG_VER%.*}/at-spi2-atk-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/at-spi2-core.xibuild b/repo/system/at-spi2-core.xibuild deleted file mode 100644 index 58e56a2..0000000 --- a/repo/system/at-spi2-core.xibuild +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -NAME="at-spi2-core" -DESC="Protocol definitions and daemon for D-Bus at-spi" - -MAKEDEPS="meson ninja " -DEPS="dbus glib intltool libx11 libxi libxtst musl " - -PKG_VER=2.44.0 -SOURCE="https://download.gnome.org/sources/at-spi2-core/${PKG_VER%.*}/at-spi2-core-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - -Dx11=yes \ - -Dintrospection=yes \ - -Ddocs=true \ - -Ddbus_daemon=/usr/bin/dbus-daemon \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install - rm -rf $PKG_DEST/usr/lib/systemd -} diff --git a/repo/system/at-spi2-core/at-spi2-core.xibuild b/repo/system/at-spi2-core/at-spi2-core.xibuild new file mode 100644 index 0000000..58e56a2 --- /dev/null +++ b/repo/system/at-spi2-core/at-spi2-core.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="at-spi2-core" +DESC="Protocol definitions and daemon for D-Bus at-spi" + +MAKEDEPS="meson ninja " +DEPS="dbus glib intltool libx11 libxi libxtst musl " + +PKG_VER=2.44.0 +SOURCE="https://download.gnome.org/sources/at-spi2-core/${PKG_VER%.*}/at-spi2-core-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + -Dx11=yes \ + -Dintrospection=yes \ + -Ddocs=true \ + -Ddbus_daemon=/usr/bin/dbus-daemon \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install + rm -rf $PKG_DEST/usr/lib/systemd +} diff --git a/repo/system/atk.xibuild b/repo/system/atk.xibuild deleted file mode 100644 index 4fd470a..0000000 --- a/repo/system/atk.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -NAME="atk" -DESC="A library providing a set of interfaces for accessibility" - -MAKEDEPS="meson ninja " -DEPS="glib intltool musl " - -PKG_VER=2.38.0 -SOURCE="https://download.gnome.org/sources/atk/${PKG_VER%.*}/atk-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/atk/atk.xibuild b/repo/system/atk/atk.xibuild new file mode 100644 index 0000000..4fd470a --- /dev/null +++ b/repo/system/atk/atk.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="atk" +DESC="A library providing a set of interfaces for accessibility" + +MAKEDEPS="meson ninja " +DEPS="glib intltool musl " + +PKG_VER=2.38.0 +SOURCE="https://download.gnome.org/sources/atk/${PKG_VER%.*}/atk-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/attr.xibuild b/repo/system/attr.xibuild deleted file mode 100644 index bbd9a27..0000000 --- a/repo/system/attr.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl" - -PKG_VER=2.5.1 -SOURCE=http://download.savannah.nongnu.org/releases/attr/attr-$PKG_VER.tar.xz - -DESC="Extended attribute support library for ACL support" - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --disable-static \ - --sysconfdir=/etc \ - --docdir=/usr/share/doc/attr-$PKG_VER - make -} - -# skip these tests since they require perl -NO_check () { - make check -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/attr/attr.xibuild b/repo/system/attr/attr.xibuild new file mode 100644 index 0000000..bbd9a27 --- /dev/null +++ b/repo/system/attr/attr.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=2.5.1 +SOURCE=http://download.savannah.nongnu.org/releases/attr/attr-$PKG_VER.tar.xz + +DESC="Extended attribute support library for ACL support" + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --disable-static \ + --sysconfdir=/etc \ + --docdir=/usr/share/doc/attr-$PKG_VER + make +} + +# skip these tests since they require perl +NO_check () { + make check +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/binutils.xibuild b/repo/system/binutils.xibuild deleted file mode 100644 index f7172ea..0000000 --- a/repo/system/binutils.xibuild +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make dejagnu bzip2 xz zlib zstd patch" -DEPS="musl zlib libelf" - -PKG_VER=2.38 -SOURCE=https://ftp.gnu.org/gnu/binutils/binutils-$PKG_VER.tar.xz - -ADDITIONAL=" -0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch -bfd-close-file-desriptor-if-there-is-no-archive-fd.patch -binutils-ld-fix-static-linking.patch -defang-no-split.patch -" - -DESC="Tools for handling object files" - -prepare () { - apply_patches - - find . -name '[a-z]*\.[0-9]*' -empty -exec rm -f {} \; -} - -build () { - mkdir build - cd build - - ../configure \ - --prefix=/usr \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --disable-multilib \ - --enable-ld=default \ - --enable-gold \ - --enable-64-bit-bfd \ - --enable-plugins \ - --enable-relro \ - --enable-install-libiberty \ - --enable-deterministic-archives \ - --enable-targets=x86_64-pep \ - --enable-default-hash-style=gnu \ - --with-pic \ - --disable-werror \ - --disable-nls \ - --with-system-zlib \ - --with-mmap - - make tooldir=/usr -} - -#check () { - #make -k check || true -#} - -package() { - make -j1 tooldir=/usr DESTDIR=$PKG_DEST install - cd .. - - # how about we use binutils ld? - rm -f $PKG_DEST/usr/bin/ld - ln -sf /usr/bin/ld.bfd $PKG_DEST/usr/bin/ld - - install -m 644 include/libiberty.h $PKG_DEST/usr/include - install -m 644 include/demangle.h $PKG_DEST/usr/include - - for f in dlltool nlmconv windres windmc; do - rm -f $PKG_DEST/usr/share/man/man1/${f}.1 - done -} diff --git a/repo/system/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch b/repo/system/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch new file mode 100644 index 0000000..6e1fa77 --- /dev/null +++ b/repo/system/binutils/0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch @@ -0,0 +1,55 @@ +From bbf05b742fde518fb97c789b043fe0d3aaf549f0 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Tue, 21 Sep 2021 14:53:13 +0000 +Subject: [PATCH] Revert "PR25882, .gnu.attributes are not checked for shared + libraries" + +This revert is needed to avoid wrongly tagging objects with the incompatible +IBM long double ABI, which is not supported by musl and will result in +linking errors if used. + +This reverts commit a8acd6eeb6dc2cc5460ece90f90ebe36b56b20ba. +--- + bfd/elf32-tic6x.c | 3 --- + ld/ldlang.c | 10 ++++------ + 2 files changed, 4 insertions(+), 9 deletions(-) + +diff --git a/bfd/elf32-tic6x.c b/bfd/elf32-tic6x.c +index 5754f3cb860..3ad1d612749 100644 +--- a/bfd/elf32-tic6x.c ++++ b/bfd/elf32-tic6x.c +@@ -3735,9 +3735,6 @@ elf32_tic6x_merge_attributes (bfd *ibfd, struct bfd_link_info *info) + + case Tag_ABI_PIC: + case Tag_ABI_PID: +- /* Don't transfer these tags from dynamic objects. */ +- if ((ibfd->flags & DYNAMIC) != 0) +- continue; + if (out_attr[i].i > in_attr[i].i) + out_attr[i].i = in_attr[i].i; + break; +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 37b64c89ee1..f13beaef9d9 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -7071,13 +7071,11 @@ lang_check (void) + bfd_printable_name (input_bfd), input_bfd, + bfd_printable_name (link_info.output_bfd)); + } +- +- /* If the input bfd has no contents, it shouldn't set the +- private data of the output bfd. */ +- else if (!file->flags.just_syms +- && ((input_bfd->flags & DYNAMIC) != 0 +- || bfd_count_sections (input_bfd) != 0)) ++ else if (bfd_count_sections (input_bfd)) + { ++ /* If the input bfd has no contents, it shouldn't set the ++ private data of the output bfd. */ ++ + bfd_error_handler_type pfn = NULL; + + /* If we aren't supposed to warn about mismatched input +-- +2.33.0 + diff --git a/repo/system/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch b/repo/system/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch new file mode 100644 index 0000000..357d0f9 --- /dev/null +++ b/repo/system/binutils/bfd-close-file-desriptor-if-there-is-no-archive-fd.patch @@ -0,0 +1,234 @@ +Upstream: yes +URL: https://sourceware.org/bugzilla/show_bug.cgi?id=28138 +From 1c611b40e6bfc8029bff7696814330b5bc0ee5c0 Mon Sep 17 00:00:00 2001 +From: "H.J. Lu" +Date: Mon, 26 Jul 2021 05:59:55 -0700 +Subject: [PATCH] bfd: Close the file descriptor if there is no archive fd + +Close the file descriptor if there is no archive plugin file descriptor +to avoid running out of file descriptors on thin archives with many +archive members. + +bfd/ + + PR ld/28138 + * plugin.c (bfd_plugin_close_file_descriptor): Close the file + descriptor there is no archive plugin file descriptor. + +ld/ + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run tmpdir/pr28138 only for + native build. + + PR ld/28138 + * testsuite/ld-plugin/lto.exp: Run ld/28138 tests. + * testsuite/ld-plugin/pr28138.c: New file. + * testsuite/ld-plugin/pr28138-1.c: Likewise. + * testsuite/ld-plugin/pr28138-2.c: Likewise. + * testsuite/ld-plugin/pr28138-3.c: Likewise. + * testsuite/ld-plugin/pr28138-4.c: Likewise. + * testsuite/ld-plugin/pr28138-5.c: Likewise. + * testsuite/ld-plugin/pr28138-6.c: Likewise. + * testsuite/ld-plugin/pr28138-7.c: Likewise. + +(cherry picked from commit 5a98fb7513b559e20dfebdbaa2a471afda3b4742) +(cherry picked from commit 7dc37e1e1209c80e0bab784df6b6bac335e836f2) +--- + bfd/plugin.c | 8 +++++++ + ld/testsuite/ld-plugin/lto.exp | 34 ++++++++++++++++++++++++++++++ + ld/testsuite/ld-plugin/pr28138-1.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-2.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-3.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-4.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-5.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-6.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138-7.c | 6 ++++++ + ld/testsuite/ld-plugin/pr28138.c | 20 ++++++++++++++++++ + 10 files changed, 104 insertions(+) + create mode 100644 ld/testsuite/ld-plugin/pr28138-1.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-2.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-3.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-4.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-5.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-6.c + create mode 100644 ld/testsuite/ld-plugin/pr28138-7.c + create mode 100644 ld/testsuite/ld-plugin/pr28138.c + +diff --git a/bfd/plugin.c b/bfd/plugin.c +index 6cfa2b66470..3bab8febe88 100644 +--- a/bfd/plugin.c ++++ b/bfd/plugin.c +@@ -291,6 +291,14 @@ bfd_plugin_close_file_descriptor (bfd *abfd, int fd) + && !bfd_is_thin_archive (abfd->my_archive)) + abfd = abfd->my_archive; + ++ /* Close the file descriptor if there is no archive plugin file ++ descriptor. */ ++ if (abfd->archive_plugin_fd == -1) ++ { ++ close (fd); ++ return; ++ } ++ + abfd->archive_plugin_fd_open_count--; + /* Dup the archive plugin file descriptor for later use, which + will be closed by _bfd_archive_close_and_cleanup. */ +diff --git a/ld/testsuite/ld-plugin/lto.exp b/ld/testsuite/ld-plugin/lto.exp +index def69e43ab3..999d911ce6a 100644 +--- a/ld/testsuite/ld-plugin/lto.exp ++++ b/ld/testsuite/ld-plugin/lto.exp +@@ -687,6 +687,40 @@ if { [is_elf_format] && [check_lto_shared_available] } { + } + } + ++run_cc_link_tests [list \ ++ [list \ ++ "Build pr28138.a" \ ++ "-T" "" \ ++ {pr28138-1.c pr28138-2.c pr28138-3.c pr28138-4.c pr28138-5.c \ ++ pr28138-6.c pr28138-7.c} {} "pr28138.a" \ ++ ] \ ++ [list \ ++ "Build pr28138.o" \ ++ "" "" \ ++ {pr28138.c} {} \ ++ ] \ ++] ++ ++set exec_output [run_host_cmd "sh" \ ++ "-c \"ulimit -n 20; \ ++ $CC -Btmpdir/ld -o tmpdir/pr28138 \ ++ tmpdir/pr28138.o tmpdir/pr28138.a\""] ++set exec_output [prune_warnings $exec_output] ++if [string match "" $exec_output] then { ++ if { [isnative] } { ++ set exec_output [run_host_cmd "tmpdir/pr28138" ""] ++ if [string match "PASS" $exec_output] then { ++ pass "PR ld/28138" ++ } else { ++ fail "PR ld/28138" ++ } ++ } else { ++ pass "PR ld/28138" ++ } ++} else { ++ fail "PR ld/28138" ++} ++ + set testname "Build liblto-11.a" + remote_file host delete "tmpdir/liblto-11.a" + set catch_output [run_host_cmd "$ar" "rc $plug_opt tmpdir/liblto-11.a tmpdir/lto-11a.o tmpdir/lto-11b.o tmpdir/lto-11c.o"] +diff --git a/ld/testsuite/ld-plugin/pr28138-1.c b/ld/testsuite/ld-plugin/pr28138-1.c +new file mode 100644 +index 00000000000..51d119e1642 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-1.c +@@ -0,0 +1,6 @@ ++extern int a0(void); ++int ++a1(void) ++{ ++ return 1 + a0(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-2.c b/ld/testsuite/ld-plugin/pr28138-2.c +new file mode 100644 +index 00000000000..1120cd797e9 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-2.c +@@ -0,0 +1,6 @@ ++extern int a1(void); ++int ++a2(void) ++{ ++ return 1 + a1(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-3.c b/ld/testsuite/ld-plugin/pr28138-3.c +new file mode 100644 +index 00000000000..ec464947ee6 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-3.c +@@ -0,0 +1,6 @@ ++extern int a2(void); ++int ++a3(void) ++{ ++ return 1 + a2(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-4.c b/ld/testsuite/ld-plugin/pr28138-4.c +new file mode 100644 +index 00000000000..475701b2c5c +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-4.c +@@ -0,0 +1,6 @@ ++extern int a3(void); ++int ++a4(void) ++{ ++ return 1 + a3(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-5.c b/ld/testsuite/ld-plugin/pr28138-5.c +new file mode 100644 +index 00000000000..e24f86c363e +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-5.c +@@ -0,0 +1,6 @@ ++extern int a4(void); ++int ++a5(void) ++{ ++ return 1 + a4(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-6.c b/ld/testsuite/ld-plugin/pr28138-6.c +new file mode 100644 +index 00000000000..b5b938bdb21 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-6.c +@@ -0,0 +1,6 @@ ++extern int a5(void); ++int ++a6(void) ++{ ++ return 1 + a5(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138-7.c b/ld/testsuite/ld-plugin/pr28138-7.c +new file mode 100644 +index 00000000000..4ef75bf0f0c +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138-7.c +@@ -0,0 +1,6 @@ ++extern int a6(void); ++int ++a7(void) ++{ ++ return 1 + a6(); ++} +diff --git a/ld/testsuite/ld-plugin/pr28138.c b/ld/testsuite/ld-plugin/pr28138.c +new file mode 100644 +index 00000000000..68252c9f382 +--- /dev/null ++++ b/ld/testsuite/ld-plugin/pr28138.c +@@ -0,0 +1,20 @@ ++#include ++ ++extern int a7(void); ++ ++int ++a0(void) ++{ ++ return 0; ++} ++ ++int ++main() ++{ ++ if (a7() == 7) ++ { ++ printf ("PASS\n"); ++ return 0; ++ } ++ return 1; ++} +-- +2.27.0 + diff --git a/repo/system/binutils/binutils-ld-fix-static-linking.patch b/repo/system/binutils/binutils-ld-fix-static-linking.patch new file mode 100644 index 0000000..bc5d762 --- /dev/null +++ b/repo/system/binutils/binutils-ld-fix-static-linking.patch @@ -0,0 +1,46 @@ +This fixes static linking for our hardened toolchain +diff --git a/ld/scripttempl/elf.sc b/ld/scripttempl/elf.sc +index e8126cb..9532bfb 100644 +--- a/ld/scripttempl/elf.sc ++++ b/ld/scripttempl/elf.sc +@@ -235,8 +235,8 @@ test "${LARGE_SECTIONS}" = "yes" && LARGE_SECTIONS=" + if test "${ENABLE_INITFINI_ARRAY}" = "yes"; then + SORT_INIT_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))" +- CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors" +- DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors" ++ CTORS_IN_INIT_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .ctors" ++ DTORS_IN_FINI_ARRAY="EXCLUDE_FILE (*crtbegin*.o *crtend*.o $OTHER_EXCLUDE_FILES) .dtors" + else + SORT_INIT_ARRAY="KEEP (*(SORT(.init_array.*)))" + SORT_FINI_ARRAY="KEEP (*(SORT(.fini_array.*)))" +@@ -270,15 +270,14 @@ CTOR=".ctors ${CONSTRUCTING-0} : + doesn't matter which directory crtbegin.o + is in. */ + +- KEEP (*crtbegin.o(.ctors)) +- KEEP (*crtbegin?.o(.ctors)) ++ KEEP (*crtbegin*.o(.ctors)) + + /* We don't want to include the .ctor section from + the crtend.o file until after the sorted ctors. + The .ctor section from the crtend file contains the + end of ctors marker and it must be last */ + +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .ctors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*(.ctors)) + ${CONSTRUCTING+${CTOR_END}} +@@ -286,9 +285,8 @@ CTOR=".ctors ${CONSTRUCTING-0} : + DTOR=".dtors ${CONSTRUCTING-0} : + { + ${CONSTRUCTING+${DTOR_START}} +- KEEP (*crtbegin.o(.dtors)) +- KEEP (*crtbegin?.o(.dtors)) +- KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o $OTHER_EXCLUDE_FILES) .dtors)) ++ KEEP (*crtbegin*.o(.dtors)) ++ KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*(.dtors)) + ${CONSTRUCTING+${DTOR_END}} diff --git a/repo/system/binutils/binutils.xibuild b/repo/system/binutils/binutils.xibuild new file mode 100644 index 0000000..f7172ea --- /dev/null +++ b/repo/system/binutils/binutils.xibuild @@ -0,0 +1,69 @@ +#!/bin/sh + +MAKEDEPS="make dejagnu bzip2 xz zlib zstd patch" +DEPS="musl zlib libelf" + +PKG_VER=2.38 +SOURCE=https://ftp.gnu.org/gnu/binutils/binutils-$PKG_VER.tar.xz + +ADDITIONAL=" +0001-Revert-PR25882-.gnu.attributes-are-not-checked-for-s.patch +bfd-close-file-desriptor-if-there-is-no-archive-fd.patch +binutils-ld-fix-static-linking.patch +defang-no-split.patch +" + +DESC="Tools for handling object files" + +prepare () { + apply_patches + + find . -name '[a-z]*\.[0-9]*' -empty -exec rm -f {} \; +} + +build () { + mkdir build + cd build + + ../configure \ + --prefix=/usr \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --disable-multilib \ + --enable-ld=default \ + --enable-gold \ + --enable-64-bit-bfd \ + --enable-plugins \ + --enable-relro \ + --enable-install-libiberty \ + --enable-deterministic-archives \ + --enable-targets=x86_64-pep \ + --enable-default-hash-style=gnu \ + --with-pic \ + --disable-werror \ + --disable-nls \ + --with-system-zlib \ + --with-mmap + + make tooldir=/usr +} + +#check () { + #make -k check || true +#} + +package() { + make -j1 tooldir=/usr DESTDIR=$PKG_DEST install + cd .. + + # how about we use binutils ld? + rm -f $PKG_DEST/usr/bin/ld + ln -sf /usr/bin/ld.bfd $PKG_DEST/usr/bin/ld + + install -m 644 include/libiberty.h $PKG_DEST/usr/include + install -m 644 include/demangle.h $PKG_DEST/usr/include + + for f in dlltool nlmconv windres windmc; do + rm -f $PKG_DEST/usr/share/man/man1/${f}.1 + done +} diff --git a/repo/system/binutils/defang-no-split.patch b/repo/system/binutils/defang-no-split.patch new file mode 100644 index 0000000..cea68ed --- /dev/null +++ b/repo/system/binutils/defang-no-split.patch @@ -0,0 +1,38 @@ +From 2dad02b6d46eef438cbd14d8511487b056628a38 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Mon, 26 Jul 2021 22:51:18 +0100 +Subject: [PATCH 1/1] texi2pod.pl: add no-op --no-split option support + [PR28144] + +Change 2faf902da ("generate single html manual page by default") +added use of --no-split option to makeinfo. binutils reuses +makeinfo options for texi2pod.pl wrapper. Unsupported option +led to silent manpage truncation. + +The change adds no-op option support. + +etc/ + PR 28144 + * texi2pod.pl: Handle no-op --no-split option. + +(cherry picked from commit 96a7037cd8573cf065aa6b12baca68696f96d9ca) +--- + etc/texi2pod.pl | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/etc/texi2pod.pl b/etc/texi2pod.pl +index 11f70d156be..dcf2b437640 100644 +--- a/etc/texi2pod.pl ++++ b/etc/texi2pod.pl +@@ -59,6 +59,8 @@ while ($_ = shift) { + $flag = shift; + } + push (@ipath, $flag); ++ } elsif (/^--no-split$/) { ++ # ignore option for makeinfo compatibility + } elsif (/^-/) { + usage(); + } else { +-- +2.27.0 + diff --git a/repo/system/binutils/gold-mips.patch b/repo/system/binutils/gold-mips.patch new file mode 100644 index 0000000..291a2aa --- /dev/null +++ b/repo/system/binutils/gold-mips.patch @@ -0,0 +1,39 @@ +# DP: Fix gold on mips64 targets. + +gold/ + +2016-08-09 Aurelien Jarno + + * configure.tgt: Add mips64el*-*-*|mips64le*-*-* and mips64*-*-*. + + +--- a/gold/configure.tgt ++++ b/gold/configure.tgt +@@ -153,6 +153,13 @@ aarch64*-*) + targ_big_endian=false + targ_extra_big_endian=true + ;; ++mips*64*el*-*-*|mips*64*le*-*-*) ++ targ_obj=mips ++ targ_machine=EM_MIPS_RS3_LE ++ targ_size=64 ++ targ_big_endian=false ++ targ_extra_big_endian=true ++ ;; + mips*el*-*-*|mips*le*-*-*) + targ_obj=mips + targ_machine=EM_MIPS_RS3_LE +@@ -160,6 +167,13 @@ mips*el*-*-*|mips*le*-*-*) + targ_big_endian=false + targ_extra_big_endian=true + ;; ++mips*64*-*-*) ++ targ_obj=mips ++ targ_machine=EM_MIPS ++ targ_size=64 ++ targ_big_endian=true ++ targ_extra_big_endian=false ++ ;; + mips*-*-*) + targ_obj=mips + targ_machine=EM_MIPS diff --git a/repo/system/binutils/ld-bfd-mips.patch b/repo/system/binutils/ld-bfd-mips.patch new file mode 100644 index 0000000..2991c88 --- /dev/null +++ b/repo/system/binutils/ld-bfd-mips.patch @@ -0,0 +1,19 @@ +--- ./ld/configure.tgt.orig ++++ ./ld/configure.tgt +@@ -541,12 +541,12 @@ + ;; + mips*-*-windiss) targ_emul=elf32mipswindiss + ;; +-mips64*el-*-linux-*) targ_emul=elf32ltsmipn32 +- targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip" ++mips64*el-*-linux-*) targ_emul=elf64ltsmip ++ targ_extra_emuls="elf32ltsmipn32 elf32btsmipn32 elf32ltsmip elf32btsmip elf64btsmip" + targ_extra_libpath=$targ_extra_emuls + ;; +-mips64*-*-linux-*) targ_emul=elf32btsmipn32 +- targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip" ++mips64*-*-linux-*) targ_emul=elf64btsmip ++ targ_extra_emuls="elf32btsmipn32 elf32ltsmipn32 elf32btsmip elf32ltsmip elf64ltsmip" + targ_extra_libpath=$targ_extra_emuls + ;; + mips*el-*-linux-*) targ_emul=elf32ltsmip diff --git a/repo/system/brotli.xibuild b/repo/system/brotli.xibuild deleted file mode 100644 index dbdd973..0000000 --- a/repo/system/brotli.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="cmake make " -DEPS="musl" - -SOURCE=https://github.com/google/brotli -DESC="A generic-purpose lossless compression algorithm" - -build () { - mkdir out && cd out - ../configure-cmake - make -} -check () { - make test -} - -package () { - make DESTDIR=$PKG_DEST install - mv $PKG_DEST/usr/local/* $PKG_DEST/usr/ -} diff --git a/repo/system/brotli/brotli.xibuild b/repo/system/brotli/brotli.xibuild new file mode 100644 index 0000000..dbdd973 --- /dev/null +++ b/repo/system/brotli/brotli.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="cmake make " +DEPS="musl" + +SOURCE=https://github.com/google/brotli +DESC="A generic-purpose lossless compression algorithm" + +build () { + mkdir out && cd out + ../configure-cmake + make +} +check () { + make test +} + +package () { + make DESTDIR=$PKG_DEST install + mv $PKG_DEST/usr/local/* $PKG_DEST/usr/ +} diff --git a/repo/system/bzip2.xibuild b/repo/system/bzip2.xibuild deleted file mode 100644 index d0d42f6..0000000 --- a/repo/system/bzip2.xibuild +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl sh" - -PKG_VER=1.0.8 -SOURCE=git://sourceware.org/git/bzip2.git -BRANCH=bzip2-$PKG_VER -DESC="a selection of programs for compressing and decompressing bzip2 files" - - -prepare () { - - # ensure symbolic links are relative - sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile -} - -build () { - make -f Makefile-libbz2_so - make clean - make -} - -package () { - make PREFIX=$PKG_DEST/usr install - - cp -a libbz2.so* $PKG_DEST/usr/lib - cp -a libbz2.so.$PKG_VER $PKG_DEST/usr/lib/libbz2.so - - cp bzip2-shared $PKG_DEST/usr/bin/bzip2 - for i in $PKG_DEST/usr/bin/bzcat $PKG_DEST/usr/bin/bunzip2; do - ln -sf bzip2 $i - done - - # remove a useless static library - rm -f $PKG_DEST/usr/lib/libbz2.a -} - diff --git a/repo/system/bzip2/bzip2.xibuild b/repo/system/bzip2/bzip2.xibuild new file mode 100644 index 0000000..d0d42f6 --- /dev/null +++ b/repo/system/bzip2/bzip2.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl sh" + +PKG_VER=1.0.8 +SOURCE=git://sourceware.org/git/bzip2.git +BRANCH=bzip2-$PKG_VER +DESC="a selection of programs for compressing and decompressing bzip2 files" + + +prepare () { + + # ensure symbolic links are relative + sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile +} + +build () { + make -f Makefile-libbz2_so + make clean + make +} + +package () { + make PREFIX=$PKG_DEST/usr install + + cp -a libbz2.so* $PKG_DEST/usr/lib + cp -a libbz2.so.$PKG_VER $PKG_DEST/usr/lib/libbz2.so + + cp bzip2-shared $PKG_DEST/usr/bin/bzip2 + for i in $PKG_DEST/usr/bin/bzcat $PKG_DEST/usr/bin/bunzip2; do + ln -sf bzip2 $i + done + + # remove a useless static library + rm -f $PKG_DEST/usr/lib/libbz2.a +} + diff --git a/repo/system/c-ares.xibuild b/repo/system/c-ares.xibuild deleted file mode 100644 index 6cf3e3f..0000000 --- a/repo/system/c-ares.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -NAME="c-ares" -DESC="An asynchronously DNS/names resolver library" - -MAKEDEPS="make " -DEPS="musl " - -PKG_VER=1.18.1 -SOURCE="https://c-ares.haxx.se/download/c-ares-$PKG_VER.tar.gz" - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/c-ares/c-ares.xibuild b/repo/system/c-ares/c-ares.xibuild new file mode 100644 index 0000000..6cf3e3f --- /dev/null +++ b/repo/system/c-ares/c-ares.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="c-ares" +DESC="An asynchronously DNS/names resolver library" + +MAKEDEPS="make " +DEPS="musl " + +PKG_VER=1.18.1 +SOURCE="https://c-ares.haxx.se/download/c-ares-$PKG_VER.tar.gz" + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/cacerts.xibuild b/repo/system/cacerts.xibuild deleted file mode 100644 index 9fef8e1..0000000 --- a/repo/system/cacerts.xibuild +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -MAKEDEPS="sbase bash sed" -DEPS="libnghttp libp11-kit" - -PKG_VER=1.7 -SOURCE=https://github.com/djlucas/make-ca/releases/download/v$PKG_VER/make-ca-$PKG_VER.tar.xz -ADDITIONAL=" - fix-sbase-coreutils.patch -" - -DESC="Root certificates needed by ssl built using make-ca" - - -prepare () { - apply_patches - sed -i "s/grep/ggrep/g" make-ca - -} - -package () { - mkdir -p $PKG_DEST/etc/ssl/certs - bash make-ca -g --force -D $PKG_DEST - chmod -R 777 $PKG_DEST || echo "couldnt change permissions for $PKG_DEST" - - install -d $PKG_DEST/usr/bin - install -d $PKG_DEST/usr/libexec/make-ca - install -m755 make-ca $PKG_DEST/usr/bin/ - install -m700 copy-trust-modifications $PKG_DEST/usr/libexec/make-ca -} diff --git a/repo/system/cacerts/cacerts.xibuild b/repo/system/cacerts/cacerts.xibuild new file mode 100644 index 0000000..9fef8e1 --- /dev/null +++ b/repo/system/cacerts/cacerts.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +MAKEDEPS="sbase bash sed" +DEPS="libnghttp libp11-kit" + +PKG_VER=1.7 +SOURCE=https://github.com/djlucas/make-ca/releases/download/v$PKG_VER/make-ca-$PKG_VER.tar.xz +ADDITIONAL=" + fix-sbase-coreutils.patch +" + +DESC="Root certificates needed by ssl built using make-ca" + + +prepare () { + apply_patches + sed -i "s/grep/ggrep/g" make-ca + +} + +package () { + mkdir -p $PKG_DEST/etc/ssl/certs + bash make-ca -g --force -D $PKG_DEST + chmod -R 777 $PKG_DEST || echo "couldnt change permissions for $PKG_DEST" + + install -d $PKG_DEST/usr/bin + install -d $PKG_DEST/usr/libexec/make-ca + install -m755 make-ca $PKG_DEST/usr/bin/ + install -m700 copy-trust-modifications $PKG_DEST/usr/libexec/make-ca +} diff --git a/repo/system/cacerts/fix-sbase-coreutils.patch b/repo/system/cacerts/fix-sbase-coreutils.patch new file mode 100644 index 0000000..8e34376 --- /dev/null +++ b/repo/system/cacerts/fix-sbase-coreutils.patch @@ -0,0 +1,12 @@ +diff -Nuar a/make-ca b/make-ca +--- a/make-ca 2020-03-08 04:55:46.000000000 +0000 ++++ b/make-ca 2022-03-09 21:41:03.786961743 +0000 +@@ -809,7 +809,7 @@ + + # Install certdata.txt + if test "${REBUILD}" == "0"; then +- install -vdm755 "${DESTDIR}${SSLDIR}" ++ install -dm755 "${DESTDIR}${SSLDIR}" + install -m644 "${WORKDIR}/certdata.txt" "${DESTDIR}${SSLDIR}/certdata.txt" + fi + diff --git a/repo/system/cairo.xibuild b/repo/system/cairo.xibuild deleted file mode 100644 index 4bc7041..0000000 --- a/repo/system/cairo.xibuild +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl libx11 freetype libpng libxcb libxext libxrender pixman zlib glib" - -PKG_VER=1.17.4 -SOURCE=https://cairographics.org/snapshots/cairo-$PKG_VER.tar.xz -DESC="A vector graphics library" - -ADDITIONAL=" -fix-mask-usage-in-image-compositor.patch -musl-stacksize.patch -pdf-font-subset-Generate-valid-font-names.patch -" - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --enable-ft \ - --enable-gobject \ - --enable-pdf \ - --enable-png \ - --enable-ps \ - --enable-svg \ - --enable-tee \ - --enable-x \ - --enable-xcb \ - --enable-xcb-shm \ - --enable-xlib \ - --enable-xlib-xrender \ - --disable-xlib-xcb - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/cairo/cairo.xibuild b/repo/system/cairo/cairo.xibuild new file mode 100644 index 0000000..4bc7041 --- /dev/null +++ b/repo/system/cairo/cairo.xibuild @@ -0,0 +1,39 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl libx11 freetype libpng libxcb libxext libxrender pixman zlib glib" + +PKG_VER=1.17.4 +SOURCE=https://cairographics.org/snapshots/cairo-$PKG_VER.tar.xz +DESC="A vector graphics library" + +ADDITIONAL=" +fix-mask-usage-in-image-compositor.patch +musl-stacksize.patch +pdf-font-subset-Generate-valid-font-names.patch +" + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-ft \ + --enable-gobject \ + --enable-pdf \ + --enable-png \ + --enable-ps \ + --enable-svg \ + --enable-tee \ + --enable-x \ + --enable-xcb \ + --enable-xcb-shm \ + --enable-xlib \ + --enable-xlib-xrender \ + --disable-xlib-xcb + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/cairo/fix-mask-usage-in-image-compositor.patch b/repo/system/cairo/fix-mask-usage-in-image-compositor.patch new file mode 100644 index 0000000..8d5717f --- /dev/null +++ b/repo/system/cairo/fix-mask-usage-in-image-compositor.patch @@ -0,0 +1,172 @@ +From 03a820b173ed1fdef6ff14b4468f5dbc02ff59be Mon Sep 17 00:00:00 2001 +From: Heiko Lewin +Date: Tue, 15 Dec 2020 16:48:19 +0100 +Subject: [PATCH 1/3] Fix mask usage in image-compositor + +--- + src/cairo-image-compositor.c | 8 ++-- + test/Makefile.sources | 1 + + test/bug-image-compositor.c | 39 ++++++++++++++++++++ + test/reference/bug-image-compositor.ref.png | Bin 0 -> 185 bytes + 4 files changed, 44 insertions(+), 4 deletions(-) + create mode 100644 test/bug-image-compositor.c + create mode 100644 test/reference/bug-image-compositor.ref.png + +diff --git a/src/cairo-image-compositor.c b/src/cairo-image-compositor.c +index 79ad69f68..4f8aaed99 100644 +--- a/src/cairo-image-compositor.c ++++ b/src/cairo-image-compositor.c +@@ -2610,14 +2610,14 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, + unsigned num_spans) + { + cairo_image_span_renderer_t *r = abstract_renderer; +- uint8_t *m; ++ uint8_t *m, *base = (uint8_t*)pixman_image_get_data(r->mask); + int x0; + + if (num_spans == 0) + return CAIRO_STATUS_SUCCESS; + + x0 = spans[0].x; +- m = r->_buf; ++ m = base; + do { + int len = spans[1].x - spans[0].x; + if (len >= r->u.composite.run_length && spans[0].coverage == 0xff) { +@@ -2655,7 +2655,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, + spans[0].x, y, + spans[1].x - spans[0].x, h); + +- m = r->_buf; ++ m = base; + x0 = spans[1].x; + } else if (spans[0].coverage == 0x0) { + if (spans[0].x != x0) { +@@ -2684,7 +2684,7 @@ _inplace_src_spans (void *abstract_renderer, int y, int h, + #endif + } + +- m = r->_buf; ++ m = base; + x0 = spans[1].x; + } else { + *m++ = spans[0].coverage; +diff --git a/test/bug-image-compositor.c b/test/bug-image-compositor.c +new file mode 100644 +index 000000000..fc4fd370b +--- /dev/null ++++ b/test/bug-image-compositor.c +@@ -0,0 +1,39 @@ ++#include "cairo-test.h" ++ ++static cairo_test_status_t ++draw (cairo_t *cr, int width, int height) ++{ ++ cairo_set_source_rgb (cr, 0., 0., 0.); ++ cairo_paint (cr); ++ ++ cairo_set_source_rgb (cr, 1., 1., 1.); ++ cairo_set_line_width (cr, 1.); ++ ++ cairo_pattern_t *p = cairo_pattern_create_linear (0, 0, width, height); ++ cairo_pattern_add_color_stop_rgb (p, 0, 0.99, 1, 1); ++ cairo_pattern_add_color_stop_rgb (p, 1, 1, 1, 1); ++ cairo_set_source (cr, p); ++ ++ cairo_move_to (cr, 0.5, -1); ++ for (int i = 0; i < width; i+=3) { ++ cairo_rel_line_to (cr, 2, 2); ++ cairo_rel_line_to (cr, 1, -2); ++ } ++ ++ cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); ++ cairo_stroke (cr); ++ ++ cairo_pattern_destroy(p); ++ ++ return CAIRO_TEST_SUCCESS; ++} ++ ++ ++CAIRO_TEST (bug_image_compositor, ++ "Crash in image-compositor", ++ "stroke, stress", /* keywords */ ++ NULL, /* requirements */ ++ 10000, 1, ++ NULL, draw) ++ ++ + +From 8bc14a6bba3bc8a64ff0749c74d9b96305bf6429 Mon Sep 17 00:00:00 2001 +From: Heiko Lewin +Date: Tue, 15 Dec 2020 17:14:18 +0100 +Subject: [PATCH 2/3] Minor cleanups + +--- + test/bug-image-compositor.c | 33 ++++++++++++++++++++++++++++++--- + 1 file changed, 30 insertions(+), 3 deletions(-) + +diff --git a/test/bug-image-compositor.c b/test/bug-image-compositor.c +index fc4fd370b..304ea089c 100644 +--- a/test/bug-image-compositor.c ++++ b/test/bug-image-compositor.c +@@ -1,5 +1,34 @@ ++/* ++ * Copyright © 2020 Uli Schlachter, Heiko Lewin ++ * ++ * Permission is hereby granted, free of charge, to any person ++ * obtaining a copy of this software and associated documentation ++ * files (the "Software"), to deal in the Software without ++ * restriction, including without limitation the rights to use, copy, ++ * modify, merge, publish, distribute, sublicense, and/or sell copies ++ * of the Software, and to permit persons to whom the Software is ++ * furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be ++ * included in all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ++ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ++ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS ++ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ++ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN ++ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE ++ * SOFTWARE. ++ * ++ * Author: Uli Schlachter ++ * Author: Heiko Lewin ++ */ + #include "cairo-test.h" + ++ ++/* This test reproduces an overflow of a mask-buffer in cairo-image-compositor.c */ ++ + static cairo_test_status_t + draw (cairo_t *cr, int width, int height) + { +@@ -13,6 +42,7 @@ draw (cairo_t *cr, int width, int height) + cairo_pattern_add_color_stop_rgb (p, 0, 0.99, 1, 1); + cairo_pattern_add_color_stop_rgb (p, 1, 1, 1, 1); + cairo_set_source (cr, p); ++ cairo_pattern_destroy(p); + + cairo_move_to (cr, 0.5, -1); + for (int i = 0; i < width; i+=3) { +@@ -23,8 +53,6 @@ draw (cairo_t *cr, int width, int height) + cairo_set_operator (cr, CAIRO_OPERATOR_SOURCE); + cairo_stroke (cr); + +- cairo_pattern_destroy(p); +- + return CAIRO_TEST_SUCCESS; + } + +@@ -36,4 +64,3 @@ CAIRO_TEST (bug_image_compositor, + 10000, 1, + NULL, draw) + +- +-- +GitLab + diff --git a/repo/system/cairo/musl-stacksize.patch b/repo/system/cairo/musl-stacksize.patch new file mode 100644 index 0000000..d10469e --- /dev/null +++ b/repo/system/cairo/musl-stacksize.patch @@ -0,0 +1,23 @@ +Reduce the footprint of stack frame usage by turning +some large(r) structures as `static __thread` instead. + +--- a/src/cairo-rectangular-scan-converter.c 2015-10-27 22:04:21.000000000 +0100 ++++ b/src/cairo-rectangular-scan-converter.c 2016-05-07 04:25:26.640851782 +0200 +@@ -489,7 +489,7 @@ + cairo_span_renderer_t *renderer, + rectangle_t **rectangles) + { +- sweep_line_t sweep_line; ++ static __thread sweep_line_t sweep_line; + rectangle_t *start, *stop; + cairo_status_t status; + +@@ -656,7 +656,7 @@ + cairo_span_renderer_t *renderer) + { + cairo_rectangular_scan_converter_t *self = converter; +- rectangle_t *rectangles_stack[CAIRO_STACK_ARRAY_LENGTH (rectangle_t *)]; ++ static __thread rectangle_t *rectangles_stack[CAIRO_STACK_ARRAY_LENGTH (rectangle_t *)]; + rectangle_t **rectangles; + struct _cairo_rectangular_scan_converter_chunk *chunk; + cairo_status_t status; diff --git a/repo/system/cairo/pdf-font-subset-Generate-valid-font-names.patch b/repo/system/cairo/pdf-font-subset-Generate-valid-font-names.patch new file mode 100644 index 0000000..d5cfe2f --- /dev/null +++ b/repo/system/cairo/pdf-font-subset-Generate-valid-font-names.patch @@ -0,0 +1,58 @@ +From a3b69a0215fdface0fd5730872a4b3242d979dca Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Tue, 9 Feb 2021 16:54:35 +0100 +Subject: [PATCH] pdf font subset: Generate valid font names + +A hash value is encoded in base 26 with upper case letters for font +names. + +Commit ed984146 replaced "numerator = abs (hash);" with "numerator = +hash;" in this code, because hash has type uint32_t and the compiler +warned about taking the absolute value of an unsigned value. However, +abs() is actually defined to take an int argument. Thus, there was some +implicit cast. + +Since numerator has type long, i.e. is signed, it is now actually +possible to get an overflow in the implicit cast and then have a +negative number. The following code is not prepared for this and +produces non-letters when encoding the hash. + +This commit fixes that problem by not using ldiv() and instead using / +and % to directly compute the needed values. This gets rid of the need +to convert to type long. Since now everything works with uint32_t, there +is no more chance for negative numbers messing things up. + +Fixes: https://gitlab.freedesktop.org/cairo/cairo/-/issues/449 +Signed-off-by: Uli Schlachter +--- + src/cairo-pdf-surface.c | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/src/cairo-pdf-surface.c b/src/cairo-pdf-surface.c +index 6da460878..52c49b6d2 100644 +--- a/src/cairo-pdf-surface.c ++++ b/src/cairo-pdf-surface.c +@@ -5310,18 +5310,14 @@ _create_font_subset_tag (cairo_scaled_font_subset_t *font_subset, + { + uint32_t hash; + int i; +- long numerator; +- ldiv_t d; + + hash = _hash_data ((unsigned char *) font_name, strlen(font_name), 0); + hash = _hash_data ((unsigned char *) (font_subset->glyphs), + font_subset->num_glyphs * sizeof(unsigned long), hash); + +- numerator = hash; + for (i = 0; i < 6; i++) { +- d = ldiv (numerator, 26); +- numerator = d.quot; +- tag[i] = 'A' + d.rem; ++ tag[i] = 'A' + (hash % 26); ++ hash /= 26; + } + tag[i] = 0; + } +-- +GitLab + diff --git a/repo/system/dbus.xibuild b/repo/system/dbus.xibuild deleted file mode 100644 index 3bbfc31..0000000 --- a/repo/system/dbus.xibuild +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="elogind" - -PKG_VER=1.12.20 -SOURCE=https://dbus.freedesktop.org/releases/dbus/dbus-$PKG_VER.tar.gz - -ADDITIONAL=" -dbus.confd -dbus.initd -dbus.trigger -" - -DESC="A message bus system allowing applications to talk to one another" - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --enable-user-session \ - --disable-doxygen-docs \ - --disable-xml-docs \ - --disable-static \ - --with-systemduserunitdir=no \ - --with-systemdsystemunitdir=no \ - --docdir=/usr/share/doc/dbus-$PKG_VER \ - --with-console-auth-dir=/run/console \ - --with-system-pid-file=/run/dbus/pid \ - --with-system-socket=/run/dbus/system_bus_socket \ - --with-x && - make -} - -package () { - make DESTDIR=$PKG_DEST install - mv usr/lib/lib*.so.* $PKG_DEST/usr/lib/ - - chown root:messagebus $PKG_DEST/usr/libexec/dbus-daemon-launch-helper && - chmod 4750 $PKG_DEST/usr/libexec/dbus-daemon-launch-helper - - cat > $PKG_DEST/etc/dbus-1/session-local.conf << "EOF" - - - - - /usr/local/share/dbus-1/services - - -EOF - - install -Dm755 dbus.initd $PKG_DEST/etc/init.d/dbus - install -Dm644 dbus.confd $PKG_DEST/etc/conf.d/dbus -} - -postinstall () { - rc-update add dbus -} diff --git a/repo/system/dbus/dbus.confd b/repo/system/dbus/dbus.confd new file mode 100644 index 0000000..0454047 --- /dev/null +++ b/repo/system/dbus/dbus.confd @@ -0,0 +1,7 @@ +# Configuration for /etc/init.d/dbus + +# Additional arguments to pass to dbus-daemon. +#command_args= + +# Uncomment to use process supervisor. +#supervisor=supervise-daemon diff --git a/repo/system/dbus/dbus.initd b/repo/system/dbus/dbus.initd new file mode 100644 index 0000000..f3f44da --- /dev/null +++ b/repo/system/dbus/dbus.initd @@ -0,0 +1,33 @@ +#!/sbin/openrc-run +name="System Message Bus" +description="D-Bus System Message Bus" + +extra_started_commands="reload" + +command="/usr/bin/dbus-daemon" +command_args="--system --nofork --nopidfile --syslog-only ${command_args:-}" +command_background="yes" +pidfile="/run/$RC_SVCNAME.pid" + +depend() { + need localmount + after bootmisc +} + +start_pre() { + checkpath -d -m755 -o root:messagebus /run/dbus || return 1 + + /usr/bin/dbus-uuidgen --ensure=/etc/machine-id +} + +stop_post() { + [ ! -S /run/dbus/system_bus_socket ] || rm -f /run/dbus/system_bus_socket +} + +reload() { + ebegin "Reloading $name configuration" + /usr/bin/dbus-send --print-reply --system --type=method_call \ + --dest=org.freedesktop.DBus \ + / org.freedesktop.DBus.ReloadConfig > /dev/null + eend $? +} diff --git a/repo/system/dbus/dbus.trigger b/repo/system/dbus/dbus.trigger new file mode 100644 index 0000000..a537bd8 --- /dev/null +++ b/repo/system/dbus/dbus.trigger @@ -0,0 +1,4 @@ +#!/bin/sh + +dbus-send --system --type=method_call --dest=org.freedesktop.DBus / \ + org.freedesktop.DBUS.ReloadConfig >/dev/null 2>&1 || : diff --git a/repo/system/dbus/dbus.xibuild b/repo/system/dbus/dbus.xibuild new file mode 100644 index 0000000..3bbfc31 --- /dev/null +++ b/repo/system/dbus/dbus.xibuild @@ -0,0 +1,60 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="elogind" + +PKG_VER=1.12.20 +SOURCE=https://dbus.freedesktop.org/releases/dbus/dbus-$PKG_VER.tar.gz + +ADDITIONAL=" +dbus.confd +dbus.initd +dbus.trigger +" + +DESC="A message bus system allowing applications to talk to one another" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --enable-user-session \ + --disable-doxygen-docs \ + --disable-xml-docs \ + --disable-static \ + --with-systemduserunitdir=no \ + --with-systemdsystemunitdir=no \ + --docdir=/usr/share/doc/dbus-$PKG_VER \ + --with-console-auth-dir=/run/console \ + --with-system-pid-file=/run/dbus/pid \ + --with-system-socket=/run/dbus/system_bus_socket \ + --with-x && + make +} + +package () { + make DESTDIR=$PKG_DEST install + mv usr/lib/lib*.so.* $PKG_DEST/usr/lib/ + + chown root:messagebus $PKG_DEST/usr/libexec/dbus-daemon-launch-helper && + chmod 4750 $PKG_DEST/usr/libexec/dbus-daemon-launch-helper + + cat > $PKG_DEST/etc/dbus-1/session-local.conf << "EOF" + + + + + /usr/local/share/dbus-1/services + + +EOF + + install -Dm755 dbus.initd $PKG_DEST/etc/init.d/dbus + install -Dm644 dbus.confd $PKG_DEST/etc/conf.d/dbus +} + +postinstall () { + rc-update add dbus +} diff --git a/repo/system/dhcp.xibuild b/repo/system/dhcp.xibuild deleted file mode 100644 index 241dee1..0000000 --- a/repo/system/dhcp.xibuild +++ /dev/null @@ -1,69 +0,0 @@ -#!/bin/sh - -MAKEDEPS="bash iproute2 openldap" -DEPS="musl libldap" - -PKG_VER=4.4.3b1 -SOURCE=https://ftp.isc.org/isc/dhcp/$PKG_VER/dhcp-$PKG_VER.tar.gz - -ADDITIONAL=" -01-dhclient-script-fix-bare-ip.patch -02-dhclient-script-remove-bashisms.patch -03-fix-unwind-import.patch -dhcpd.confd -dhcpd.initd -" - -DESC="A DHCP server, client and relay" - -package () { - apply_patches - - sed -i '/o.*dhcp_type/d' server/mdb.c && - sed -r '/u.*(local|remote)_port/d' \ - -i client/dhclient.c \ - relay/dhcrelay.c -} - - -build () { - # fix ipv6 - - export CFLAGS="$CFLAGS -D_GNU_SOURCE \ - -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" - - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc/dhcp \ - --localstatedir=/var \ - --with-srv-conf-file=/etc/dhcp/dhcpd.conf \ - --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ - --with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \ - --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \ - --with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \ - --with-srv-pid-file=/run/dhcp/dhcpd.pid \ - --with-srv6-pid-file=/run/dhcp/dhcpd6.pid \ - --with-cli-pid-file=/run/dhcp/dhclient.pid \ - --with-cli6-pid-file=/run/dhcp/dhclient6.pid \ - --with-relay-pid-file=/run/dhcp/dhcrelay.pid \ - --with-relay6-pid-file=/run/dhcp/dhcrelay6.pid \ - --with-libbind=no \ - --enable-dhcpv4o6 \ - --enable-paranoia \ - --enable-log-pid \ - - make -j1 -C bind && make -} - -package () { - make DESTDIR=$PKG_DEST install - - install -d $PKG_DEST/var/lib/dhcp - install -d $PKG_DEST/run/dhcp - - - install -m755 -D dhcpd.initd $PKG_DEST/etc/init.d/dhcpd - install -m644 -D dhcpd.confd $PKG_DEST/etc/conf.d/dhcpd - -} - diff --git a/repo/system/dhcp/01-dhclient-script-fix-bare-ip.patch b/repo/system/dhcp/01-dhclient-script-fix-bare-ip.patch new file mode 100644 index 0000000..7b3165d --- /dev/null +++ b/repo/system/dhcp/01-dhclient-script-fix-bare-ip.patch @@ -0,0 +1,13 @@ +diff --git a/client/scripts/linux b/client/scripts/linux +index 0c42969..3cd2a75 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -394,7 +394,7 @@ case "$reason" in + make_resolv_conf + else + # flush all IPs from interface +- ip -4 addr flush dev ${interface} ++ ${ip} -4 addr flush dev ${interface} + exit_with_hooks 2 + fi + diff --git a/repo/system/dhcp/02-dhclient-script-remove-bashisms.patch b/repo/system/dhcp/02-dhclient-script-remove-bashisms.patch new file mode 100644 index 0000000..afa1048 --- /dev/null +++ b/repo/system/dhcp/02-dhclient-script-remove-bashisms.patch @@ -0,0 +1,28 @@ +diff --git a/client/scripts/linux b/client/scripts/linux +index 0c42969..2e7274b 100755 +--- a/client/scripts/linux ++++ b/client/scripts/linux +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!/bin/sh + # dhclient-script for Linux. Dan Halbert, March, 1997. + # Updated for Linux 2.[12] by Brian J. Murrell, January 1999. + # No guarantees about this. I'm a novice at the details of Linux +@@ -428,7 +428,7 @@ case "$reason" in + # Check if any IPv6 address on this interface is marked as + # tentative. + ${ip} addr show ${interface} | grep inet6 | grep tentative \ +- &> /dev/null ++ > /dev/null 2>&1 + if [ $? -eq 0 ]; then + # Wait for duplicate address detection to complete or for + # the timeout specified as --dad-wait-time. +@@ -437,7 +437,7 @@ case "$reason" in + # We're going to poll for the tentative flag every second. + sleep 1 + ${ip} addr show ${interface} | grep inet6 | grep tentative \ +- &> /dev/null ++ > /dev/null 2>&1 + if [ $? -ne 0 ]; then + break; + fi diff --git a/repo/system/dhcp/03-fix-unwind-import.patch b/repo/system/dhcp/03-fix-unwind-import.patch new file mode 100644 index 0000000..8b87fdb --- /dev/null +++ b/repo/system/dhcp/03-fix-unwind-import.patch @@ -0,0 +1,16 @@ +bind assumes _Unwind_GetIP is a function which is not necessarily +true. In some implementations of libunwind it's a macro. +This fixes the build on Alpine on armhf and armv7. + +--- a/bind/bind-9.11.36/lib/isc/backtrace.c ++++ b/bind/bind-9.11.36/lib/isc/backtrace.c +@@ -81,8 +81,7 @@ isc_backtrace_gettrace(void **addrs, int + return (ISC_R_SUCCESS); + } + #elif defined(BACKTRACE_GCC) +-extern int _Unwind_Backtrace(void* fn, void* a); +-extern void* _Unwind_GetIP(void* ctx); ++#include + + typedef struct { + void **result; diff --git a/repo/system/dhcp/dhcp.xibuild b/repo/system/dhcp/dhcp.xibuild new file mode 100644 index 0000000..241dee1 --- /dev/null +++ b/repo/system/dhcp/dhcp.xibuild @@ -0,0 +1,69 @@ +#!/bin/sh + +MAKEDEPS="bash iproute2 openldap" +DEPS="musl libldap" + +PKG_VER=4.4.3b1 +SOURCE=https://ftp.isc.org/isc/dhcp/$PKG_VER/dhcp-$PKG_VER.tar.gz + +ADDITIONAL=" +01-dhclient-script-fix-bare-ip.patch +02-dhclient-script-remove-bashisms.patch +03-fix-unwind-import.patch +dhcpd.confd +dhcpd.initd +" + +DESC="A DHCP server, client and relay" + +package () { + apply_patches + + sed -i '/o.*dhcp_type/d' server/mdb.c && + sed -r '/u.*(local|remote)_port/d' \ + -i client/dhclient.c \ + relay/dhcrelay.c +} + + +build () { + # fix ipv6 + + export CFLAGS="$CFLAGS -D_GNU_SOURCE \ + -D_PATH_DHCLIENT_CONF='\"/etc/dhcp/dhclient.conf\"'" + + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc/dhcp \ + --localstatedir=/var \ + --with-srv-conf-file=/etc/dhcp/dhcpd.conf \ + --with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \ + --with-srv6-lease-file=/var/lib/dhcp/dhcpd6.leases \ + --with-cli-lease-file=/var/lib/dhcp/dhclient.leases \ + --with-cli6-lease-file=/var/lib/dhcp/dhclient6.leases \ + --with-srv-pid-file=/run/dhcp/dhcpd.pid \ + --with-srv6-pid-file=/run/dhcp/dhcpd6.pid \ + --with-cli-pid-file=/run/dhcp/dhclient.pid \ + --with-cli6-pid-file=/run/dhcp/dhclient6.pid \ + --with-relay-pid-file=/run/dhcp/dhcrelay.pid \ + --with-relay6-pid-file=/run/dhcp/dhcrelay6.pid \ + --with-libbind=no \ + --enable-dhcpv4o6 \ + --enable-paranoia \ + --enable-log-pid \ + + make -j1 -C bind && make +} + +package () { + make DESTDIR=$PKG_DEST install + + install -d $PKG_DEST/var/lib/dhcp + install -d $PKG_DEST/run/dhcp + + + install -m755 -D dhcpd.initd $PKG_DEST/etc/init.d/dhcpd + install -m644 -D dhcpd.confd $PKG_DEST/etc/conf.d/dhcpd + +} + diff --git a/repo/system/dhcp/dhcpd.confd b/repo/system/dhcp/dhcpd.confd new file mode 100644 index 0000000..5cd2eec --- /dev/null +++ b/repo/system/dhcp/dhcpd.confd @@ -0,0 +1,28 @@ +# /etc/conf.d/dhcpd: config file for /etc/init.d/dhcpd + +# If you require more than one instance of dhcpd you can create symbolic +# links to dhcpd service like so +# cd /etc/init.d +# ln -s dhcpd dhcpd.foo +# cd ../conf.d +# cp dhcpd dhcpd.foo +# Now you can edit dhcpd.foo and specify a different configuration file. +# You'll also need to specify a pidfile in that dhcpd.conf file. +# See the pid-file-name option in the dhcpd.conf man page for details. + +# If you wish to run dhcpd in a chroot, uncomment the following line +# DHCPD_CHROOT="/var/lib/dhcp/chroot" + +# All file paths below are relative to the chroot. +# You can specify a different chroot directory but MAKE SURE it's empty. + +# Specify a configuration file - the default is /etc/dhcp/dhcpd.conf +# DHCPD_CONF="/etc/dhcp/dhcpd.conf" + +# Configure which interface or interfaces to for dhcpd to listen on. +# List all interfaces space separated. If this is not specified then +# we listen on all interfaces. +# DHCPD_IFACE="" + +# Insert any other dhcpd options - see the man page for a full list. +# DHCPD_OPTS="" diff --git a/repo/system/dhcp/dhcpd.initd b/repo/system/dhcp/dhcpd.initd new file mode 100644 index 0000000..f69ae71 --- /dev/null +++ b/repo/system/dhcp/dhcpd.initd @@ -0,0 +1,115 @@ +#!/sbin/openrc-run +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/files/dhcpd.init5,v 1.1 2011/12/04 22:45:07 vapier Exp $ + +extra_commands="configtest" + +: ${DHCPD_CONF:=/etc/dhcp/${SVCNAME}.conf} + +depend() { + need net + after firewall + use logger dns +} + +get_var() { + local var="$(sed -n 's/^[[:blank:]]\?'"$1"' "*\([^#";]\+\).*/\1/p' "${chroot}${DHCPD_CONF}")" + echo ${var:-$2} +} + +checkconfig() { + set -- ${DHCPD_OPTS} ${chroot:+-chroot} ${chroot} -t + + dhcpd "$@" 1>/dev/null 2>&1 + local ret=$? + if [ ${ret} -ne 0 ] ; then + eerror "${SVCNAME} has detected a syntax error in your configuration files:" + dhcpd "$@" + fi + + return ${ret} +} + +configtest() { + local chroot=${DHCPD_CHROOT%/} + + ebegin "Checking ${SVCNAME} configuration" + checkconfig + eend $? +} + +start() { + local chroot=${DHCPD_CHROOT%/} + + # Work out our cffile if it's in our DHCPD_OPTS + case " ${DHCPD_OPTS} " in + *" -cf "*) + DHCPD_CONF=" ${DHCPD_OPTS} " + DHCPD_CONF="${DHCPD_CONF##* -cf }" + DHCPD_CONF="${DHCPD_CONF%% *}" + ;; + *) DHCPD_OPTS="${DHCPD_OPTS} -cf ${DHCPD_CONF}" + ;; + esac + + if [ -n "${chroot}" ] ; then + # the config test want's these to exist + mkdir -p \ + "${chroot}"/run/dhcp \ + "${chroot}"/var/lib/dhcp \ + "${chroot}"/etc/dhcp + fi + + # see comment in get_var() above + if [ ! -f "${chroot}${DHCPD_CONF}" ] ; then + eerror "${chroot}${DHCPD_CONF} does not exist" + return 1 + fi + + checkconfig || return 1 + + checkpath -d -o dhcp:dhcp "${chroot}"/run/dhcp "${chroot}"/var/lib/dhcp + + local leasefile="$(get_var lease-file-name /var/lib/dhcp/${SVCNAME}.leases)" + checkpath -f -o dhcp:dhcp "${chroot}${leasefile}" + + # Setup LD_PRELOAD so name resolution works in our chroot. + if [ -n "${chroot}" ] ; then + checkpath -d -o root:root -m 755 "${chroot}"/dev "${chroot}"/etc "${chroot}"/proc + cp -pP /etc/localtime /etc/resolv.conf "${chroot}"/etc/ + export LD_PRELOAD="${LD_PRELOAD} libresolv.so libnss_dns.so" + if ! mountinfo -q "${chroot}/proc" ; then + mount --bind /proc "${chroot}/proc" + fi + fi + + local pidfile="$(get_var pid-file-name /run/dhcp/${SVCNAME}.pid)" + + ebegin "Starting ${chroot:+chrooted }${SVCNAME}" + start-stop-daemon --start --exec /usr/sbin/dhcpd \ + --pidfile "${chroot}/${pidfile}" \ + -- ${DHCPD_OPTS} -q -pf "${pidfile}" -lf "${leasefile}" \ + -user dhcp -group dhcp \ + ${chroot:+-chroot} ${chroot} ${DHCPD_IFACE} + eend $? \ + && save_options chroot "${chroot}" \ + && save_options pidfile "${pidfile}" +} + +stop() { + local chroot="$(get_options chroot)" + + ebegin "Stopping ${chroot:+chrooted }${SVCNAME}" + start-stop-daemon --stop --exec /usr/sbin/dhcpd \ + --pidfile "${chroot}/$(get_options pidfile)" + res=$? + + if [ ${res} -eq 0 ] && [ -n "${chroot}" ] ; then + if mountinfo -q "${chroot}/proc" ; then + umount "${chroot}/proc" + fi + fi + + eend $res +} diff --git a/repo/system/efibootmgr.xibuild b/repo/system/efibootmgr.xibuild deleted file mode 100644 index ae58a48..0000000 --- a/repo/system/efibootmgr.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="efivar popt" - -PKG_VER=17 -SOURCE=https://github.com/rhboot/efibootmgr/archive/$PKG_VER/efibootmgr-$PKG_VER.tar.gz -DESC="Tools and libraries to manipulate EFI variables" - -prepare () { - # fix an outdated hotfix declaration causing compilation failure - sed -e '/extern int efi_set_verbose/d' -i src/efibootmgr.c -} - -build () { - make EFIDIR=XI EFI_LOADER=grubx64.efi -} - -package () { - make EFIDIR=XI DESTDIR=$PKG_DEST install -} diff --git a/repo/system/efibootmgr/efibootmgr.xibuild b/repo/system/efibootmgr/efibootmgr.xibuild new file mode 100644 index 0000000..ae58a48 --- /dev/null +++ b/repo/system/efibootmgr/efibootmgr.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="efivar popt" + +PKG_VER=17 +SOURCE=https://github.com/rhboot/efibootmgr/archive/$PKG_VER/efibootmgr-$PKG_VER.tar.gz +DESC="Tools and libraries to manipulate EFI variables" + +prepare () { + # fix an outdated hotfix declaration causing compilation failure + sed -e '/extern int efi_set_verbose/d' -i src/efibootmgr.c +} + +build () { + make EFIDIR=XI EFI_LOADER=grubx64.efi +} + +package () { + make EFIDIR=XI DESTDIR=$PKG_DEST install +} diff --git a/repo/system/efivar.xibuild b/repo/system/efivar.xibuild deleted file mode 100644 index 2b5b666..0000000 --- a/repo/system/efivar.xibuild +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make patch" -DEPS="musl" - -PKG_VER=37 -SOURCE=https://github.com/rhboot/efivar/releases/download/$PKG_VER/efivar-$PKG_VER.tar.bz2 - -ADDITIONAL=" - patches/musl-bswap.patch - patches/efivar-fix-format_guid.patch - patches/efivar-fix-packed.patch - patches/efivar-fix-ucs2.patch -" - -DESC="Tools and libraries to manupulate EFI variables" - -prepare() { - apply_patches - - # remove verbosity in ln commands - for f in Makefile src/Makefile src/test/Makefile docs/Makefile Make.rules; do - echo "patching $f" - sed -i "s@-vfs@-fs@g" $f - sed -i "s@-rfv@-rf@g" $f - done -} - -build () { - make CFLAGS="-O2 -Wno-stringop-truncation" -} - -package () { - make LIBDIR=/usr/lib DESTDIR=$PKG_DEST install -} diff --git a/repo/system/efivar/efivar.xibuild b/repo/system/efivar/efivar.xibuild new file mode 100644 index 0000000..2b5b666 --- /dev/null +++ b/repo/system/efivar/efivar.xibuild @@ -0,0 +1,35 @@ +#!/bin/sh + +MAKEDEPS="make patch" +DEPS="musl" + +PKG_VER=37 +SOURCE=https://github.com/rhboot/efivar/releases/download/$PKG_VER/efivar-$PKG_VER.tar.bz2 + +ADDITIONAL=" + patches/musl-bswap.patch + patches/efivar-fix-format_guid.patch + patches/efivar-fix-packed.patch + patches/efivar-fix-ucs2.patch +" + +DESC="Tools and libraries to manupulate EFI variables" + +prepare() { + apply_patches + + # remove verbosity in ln commands + for f in Makefile src/Makefile src/test/Makefile docs/Makefile Make.rules; do + echo "patching $f" + sed -i "s@-vfs@-fs@g" $f + sed -i "s@-rfv@-rf@g" $f + done +} + +build () { + make CFLAGS="-O2 -Wno-stringop-truncation" +} + +package () { + make LIBDIR=/usr/lib DESTDIR=$PKG_DEST install +} diff --git a/repo/system/efivar/patches/efivar-fix-format_guid.patch b/repo/system/efivar/patches/efivar-fix-format_guid.patch new file mode 100644 index 0000000..f40942f --- /dev/null +++ b/repo/system/efivar/patches/efivar-fix-format_guid.patch @@ -0,0 +1,56 @@ +From b98ba8921010d03f46704a476c69861515deb1ca Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Mon, 7 Jan 2019 10:30:59 -0500 +Subject: [PATCH] dp.h: make format_guid() handle misaligned guid pointers + safely. + +GCC 9 adds -Werror=address-of-packed-member, which causes us to see the +build error reported at + https://bugzilla.opensuse.org/show_bug.cgi?id=1120862 . + +That bug report shows us the following: + +In file included from dp.c:26: +dp.h: In function 'format_vendor_helper': +dp.h:120:37: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member] + 120 | format_guid(buf, size, off, label, &dp->hw_vendor.vendor_guid); + | ^~~~~~~~~~~~~~~~~~~~~~~~~~ +dp.h:74:25: note: in definition of macro 'format_guid' + 74 | _rc = efi_guid_to_str(guid, &_guidstr); \ + | ^~~~ +cc1: all warnings being treated as errors + +This patch makes format_guid() use a local variable as a bounce buffer +in the case that the guid we're passed is aligned as chaotic neutral. + +Note that this only fixes this instance and there may be others that bz +didn't show because it exited too soon, and I don't have a gcc 9 build +in front of me right now. + +Signed-off-by: Peter Jones +--- + src/dp.h | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/dp.h b/src/dp.h +index aa4e390..20cb608 100644 +--- a/src/dp.h ++++ b/src/dp.h +@@ -70,8 +70,15 @@ + #define format_guid(buf, size, off, dp_type, guid) ({ \ + int _rc; \ + char *_guidstr = NULL; \ +- \ +- _rc = efi_guid_to_str(guid, &_guidstr); \ ++ efi_guid_t _guid; \ ++ const efi_guid_t * const _guid_p = \ ++ likely(__alignof__(guid) == sizeof(guid)) \ ++ ? guid \ ++ : &_guid; \ ++ \ ++ if (unlikely(__alignof__(guid) == sizeof(guid))) \ ++ memmove(&_guid, guid, sizeof(_guid)); \ ++ _rc = efi_guid_to_str(_guid_p, &_guidstr); \ + if (_rc < 0) { \ + efi_error("could not build %s GUID DP string", \ + dp_type); \ diff --git a/repo/system/efivar/patches/efivar-fix-packed.patch b/repo/system/efivar/patches/efivar-fix-packed.patch new file mode 100644 index 0000000..bbb6a99 --- /dev/null +++ b/repo/system/efivar/patches/efivar-fix-packed.patch @@ -0,0 +1,168 @@ +From c3c553db85ff10890209d0fe48fb4856ad68e4e0 Mon Sep 17 00:00:00 2001 +From: Peter Jones +Date: Thu, 21 Feb 2019 15:20:12 -0500 +Subject: [PATCH] Fix all the places -Werror=address-of-packed-member catches. + +This gets rid of all the places GCC 9's -Werror=address-of-packed-member +flags as problematic. + +Fixes github issue #123 + +Signed-off-by: Peter Jones +--- + src/dp-message.c | 6 ++++-- + src/dp.h | 12 ++++-------- + src/guid.c | 2 +- + src/include/efivar/efivar.h | 2 +- + src/ucs2.h | 27 +++++++++++++++++++-------- + 5 files changed, 29 insertions(+), 20 deletions(-) + +diff --git a/src/dp-message.c b/src/dp-message.c +index 3724e5f..9f96466 100644 +--- a/src/dp-message.c ++++ b/src/dp-message.c +@@ -620,11 +620,13 @@ _format_message_dn(char *buf, size_t size, const_efidp dp) + ) / sizeof(efi_ip_addr_t); + format(buf, size, off, "Dns", "Dns("); + for (int i=0; i < end; i++) { +- const efi_ip_addr_t *addr = &dp->dns.addrs[i]; ++ efi_ip_addr_t addr; ++ ++ memcpy(&addr, &dp->dns.addrs[i], sizeof(addr)); + if (i != 0) + format(buf, size, off, "Dns", ","); + format_ip_addr(buf, size, off, "Dns", +- dp->dns.is_ipv6, addr); ++ dp->dns.is_ipv6, &addr); + } + format(buf, size, off, "Dns", ")"); + break; +diff --git a/src/dp.h b/src/dp.h +index 20cb608..1f921d5 100644 +--- a/src/dp.h ++++ b/src/dp.h +@@ -71,13 +71,9 @@ + int _rc; \ + char *_guidstr = NULL; \ + efi_guid_t _guid; \ +- const efi_guid_t * const _guid_p = \ +- likely(__alignof__(guid) == sizeof(guid)) \ +- ? guid \ +- : &_guid; \ +- \ +- if (unlikely(__alignof__(guid) == sizeof(guid))) \ +- memmove(&_guid, guid, sizeof(_guid)); \ ++ const efi_guid_t * const _guid_p = &_guid; \ ++ \ ++ memmove(&_guid, guid, sizeof(_guid)); \ + _rc = efi_guid_to_str(_guid_p, &_guidstr); \ + if (_rc < 0) { \ + efi_error("could not build %s GUID DP string", \ +@@ -86,7 +82,7 @@ + _guidstr = onstack(_guidstr, \ + strlen(_guidstr)+1); \ + _rc = format(buf, size, off, dp_type, "%s", \ +- _guidstr); \ ++ _guidstr); \ + } \ + _rc; \ + }) +diff --git a/src/guid.c b/src/guid.c +index 306c9ff..3156b3b 100644 +--- a/src/guid.c ++++ b/src/guid.c +@@ -31,7 +31,7 @@ + extern const efi_guid_t efi_guid_zero; + + int NONNULL(1, 2) PUBLIC +-efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b) ++efi_guid_cmp(const void * const a, const void * const b) + { + return memcmp(a, b, sizeof (efi_guid_t)); + } +diff --git a/src/include/efivar/efivar.h b/src/include/efivar/efivar.h +index 316891c..ad6449d 100644 +--- a/src/include/efivar/efivar.h ++++ b/src/include/efivar/efivar.h +@@ -128,7 +128,7 @@ extern int efi_symbol_to_guid(const char *symbol, efi_guid_t *guid) + + extern int efi_guid_is_zero(const efi_guid_t *guid); + extern int efi_guid_is_empty(const efi_guid_t *guid); +-extern int efi_guid_cmp(const efi_guid_t *a, const efi_guid_t *b); ++extern int efi_guid_cmp(const void * const a, const void * const b); + + /* import / export functions */ + typedef struct efi_variable efi_variable_t; +diff --git a/src/ucs2.h b/src/ucs2.h +index dbb5900..edd8367 100644 +--- a/src/ucs2.h ++++ b/src/ucs2.h +@@ -23,16 +23,21 @@ + (((val) & ((mask) << (shift))) >> (shift)) + + static inline size_t UNUSED +-ucs2len(const uint16_t * const s, ssize_t limit) ++ucs2len(const void *vs, ssize_t limit) + { + ssize_t i; +- for (i = 0; i < (limit >= 0 ? limit : i+1) && s[i] != (uint16_t)0; i++) ++ const uint16_t *s = vs; ++ const uint8_t *s8 = vs; ++ ++ for (i = 0; ++ i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; ++ i++, s8 += 2, s++) + ; + return i; + } + + static inline size_t UNUSED +-ucs2size(const uint16_t * const s, ssize_t limit) ++ucs2size(const void *s, ssize_t limit) + { + size_t rc = ucs2len(s, limit); + rc *= sizeof (uint16_t); +@@ -69,10 +74,11 @@ utf8size(uint8_t *s, ssize_t limit) + } + + static inline unsigned char * UNUSED +-ucs2_to_utf8(const uint16_t * const chars, ssize_t limit) ++ucs2_to_utf8(const void * const voidchars, ssize_t limit) + { + ssize_t i, j; + unsigned char *ret; ++ const uint16_t * const chars = voidchars; + + if (limit < 0) + limit = ucs2len(chars, -1); +@@ -124,10 +130,12 @@ ucs2_to_utf8(const uint16_t * const chars, ssize_t limit) + } + + static inline ssize_t UNUSED NONNULL(4) +-utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8) ++utf8_to_ucs2(void *ucs2void, ssize_t size, int terminate, uint8_t *utf8) + { + ssize_t req; + ssize_t i, j; ++ uint16_t *ucs2 = ucs2void; ++ uint16_t val16; + + if (!ucs2 && size > 0) { + errno = EINVAL; +@@ -162,10 +170,13 @@ utf8_to_ucs2(uint16_t *ucs2, ssize_t size, int terminate, uint8_t *utf8) + val = utf8[i] & 0x7f; + i += 1; + } +- ucs2[j] = val; ++ val16 = val; ++ ucs2[j] = val16; ++ } ++ if (terminate) { ++ val16 = 0; ++ ucs2[j++] = val16; + } +- if (terminate) +- ucs2[j++] = (uint16_t)0; + return j; + }; + diff --git a/repo/system/efivar/patches/efivar-fix-ucs2.patch b/repo/system/efivar/patches/efivar-fix-ucs2.patch new file mode 100644 index 0000000..594da61 --- /dev/null +++ b/repo/system/efivar/patches/efivar-fix-ucs2.patch @@ -0,0 +1,59 @@ +From fdb803402fb32fa6d020bac57a40c7efe4aabb7d Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 5 Mar 2019 17:23:24 +0100 +Subject: [PATCH] ucs2.h: remove unused variable + +The const uint16_t pointer is not used since now the two bytes of the +UCS-2 chars are checked to know if is the termination of the string. + +Signed-off-by: Javier Martinez Canillas +--- + src/ucs2.h | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/src/ucs2.h b/src/ucs2.h +index edd8367..e0390c3 100644 +--- a/src/ucs2.h ++++ b/src/ucs2.h +@@ -26,12 +26,11 @@ static inline size_t UNUSED + ucs2len(const void *vs, ssize_t limit) + { + ssize_t i; +- const uint16_t *s = vs; + const uint8_t *s8 = vs; + + for (i = 0; + i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; +- i++, s8 += 2, s++) ++ i++, s8 += 2) + ; + return i; + } +From 4e04afc2df9bbc26e5ab524b53a6f4f1e61d7c9e Mon Sep 17 00:00:00 2001 +From: Javier Martinez Canillas +Date: Tue, 5 Mar 2019 17:23:32 +0100 +Subject: [PATCH] ucs2.h: fix logic that checks for UCS-2 string termination + +Currently the loop to count the lenght of the UCS-2 string ends if either +of the two bytes are 0, but 0 is a valid value for UCS-2 character codes. + +So only break the loop when 0 is the value for both UCS-2 char bytes. + +Signed-off-by: Javier Martinez Canillas +--- + src/ucs2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ucs2.h b/src/ucs2.h +index e0390c3..fd8b056 100644 +--- a/src/ucs2.h ++++ b/src/ucs2.h +@@ -29,7 +29,7 @@ ucs2len(const void *vs, ssize_t limit) + const uint8_t *s8 = vs; + + for (i = 0; +- i < (limit >= 0 ? limit : i+1) && s8[0] != 0 && s8[1] != 0; ++ i < (limit >= 0 ? limit : i+1) && !(s8[0] == 0 && s8[1] == 0); + i++, s8 += 2) + ; + return i; diff --git a/repo/system/efivar/patches/musl-bswap.patch b/repo/system/efivar/patches/musl-bswap.patch new file mode 100644 index 0000000..8b86d9a --- /dev/null +++ b/repo/system/efivar/patches/musl-bswap.patch @@ -0,0 +1,33 @@ +From c9b54ee2cd504542cac4ed95fa7842bd14b39f9c Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Fri, 18 Aug 2017 20:36:03 -0500 +Subject: [PATCH] makeguids: Ensure compatibility with other libcs + +The musl libc does not provide __bswap_constant_XX. +If does not provide these macros, use our own. + +This fixes issue #84. +--- + src/makeguids.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/src/makeguids.c b/src/makeguids.c +index ec75a86..6b0d80e 100644 +--- a/src/makeguids.c ++++ b/src/makeguids.c +@@ -152,6 +152,15 @@ main(int argc, char *argv[]) + fprintf(symout, "#include \n"); + fprintf(symout, "#include \n"); + fprintf(symout, """\n\ ++#ifndef __bswap_constant_16\n\ ++#define __bswap_constant_16(x)\\\n\ ++ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))\n\ ++#endif\n\ ++#ifndef __bswap_constant_32\n\ ++#define __bswap_constant_32(x)\\\n\ ++ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \\\n\ ++ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))\n\ ++#endif\n\ + #if BYTE_ORDER == BIG_ENDIAN\n\ + #define cpu_to_be32(n) (n)\n\ + #define cpu_to_be16(n) (n)\n\ diff --git a/repo/system/elfutils.xibuild b/repo/system/elfutils.xibuild deleted file mode 100644 index a68827f..0000000 --- a/repo/system/elfutils.xibuild +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -MAKEDEPS="bison flex zlib bzip2 xz argp-standalone libtool fts musl-obstack" -DEPS="musl zlib" - -PKG_VER=0.186 -SOURCE=https://sourceware.org/elfutils/ftp/$PKG_VER/elfutils-$PKG_VER.tar.bz2 -ADDITIONAL=" - files/error.h - patches/fix-aarch64_fregs.patch - patches/fix-uninitialized.patch - patches/musl-macros.patch - patches/musl-strndupa.patch - patches/musl-asm-ptrace-h.patch -" - -DESC="Utilities and DSOs to handle ELF files and DWARF data" - -prepare () { - apply_patches - - cp error.h lib - cp error.h src - - cat > lib/libintl.h <<-EOF - #ifndef LIBINTL_H - #define LIBINTL_H - #define _(x) (x) - #endif - EOF - -} - -build () { - CFLAGS="$CFLAGS -Wno-error -Wno-null-dereference" \ - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --disable-werror \ - --program-prefix=eu- \ - --enable-deterministic-archives \ - --disable-nls \ - --disable-libdebuginfod \ - --disable-debuginfod - make -} - -package() { - make DESTDIR=$PKG_DEST install - rm -r "$PKG_DEST"/usr/lib/libelf.so.* - rm -r "$PKG_DEST"/usr/include/libelf.h -} diff --git a/repo/system/elfutils/elfutils.xibuild b/repo/system/elfutils/elfutils.xibuild new file mode 100644 index 0000000..a68827f --- /dev/null +++ b/repo/system/elfutils/elfutils.xibuild @@ -0,0 +1,54 @@ +#!/bin/sh + +MAKEDEPS="bison flex zlib bzip2 xz argp-standalone libtool fts musl-obstack" +DEPS="musl zlib" + +PKG_VER=0.186 +SOURCE=https://sourceware.org/elfutils/ftp/$PKG_VER/elfutils-$PKG_VER.tar.bz2 +ADDITIONAL=" + files/error.h + patches/fix-aarch64_fregs.patch + patches/fix-uninitialized.patch + patches/musl-macros.patch + patches/musl-strndupa.patch + patches/musl-asm-ptrace-h.patch +" + +DESC="Utilities and DSOs to handle ELF files and DWARF data" + +prepare () { + apply_patches + + cp error.h lib + cp error.h src + + cat > lib/libintl.h <<-EOF + #ifndef LIBINTL_H + #define LIBINTL_H + #define _(x) (x) + #endif + EOF + +} + +build () { + CFLAGS="$CFLAGS -Wno-error -Wno-null-dereference" \ + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-werror \ + --program-prefix=eu- \ + --enable-deterministic-archives \ + --disable-nls \ + --disable-libdebuginfod \ + --disable-debuginfod + make +} + +package() { + make DESTDIR=$PKG_DEST install + rm -r "$PKG_DEST"/usr/lib/libelf.so.* + rm -r "$PKG_DEST"/usr/include/libelf.h +} diff --git a/repo/system/elfutils/files/error.h b/repo/system/elfutils/files/error.h new file mode 100644 index 0000000..ef06827 --- /dev/null +++ b/repo/system/elfutils/files/error.h @@ -0,0 +1,27 @@ +#ifndef _ERROR_H_ +#define _ERROR_H_ + +#include +#include +#include +#include +#include + +static unsigned int error_message_count = 0; + +static inline void error(int status, int errnum, const char* format, ...) +{ + va_list ap; + fprintf(stderr, "%s: ", program_invocation_name); + va_start(ap, format); + vfprintf(stderr, format, ap); + va_end(ap); + if (errnum) + fprintf(stderr, ": %s", strerror(errnum)); + fprintf(stderr, "\n"); + error_message_count++; + if (status) + exit(status); +} + +#endif /* _ERROR_H_ */ diff --git a/repo/system/elfutils/patches/fix-aarch64_fregs.patch b/repo/system/elfutils/patches/fix-aarch64_fregs.patch new file mode 100644 index 0000000..4007416 --- /dev/null +++ b/repo/system/elfutils/patches/fix-aarch64_fregs.patch @@ -0,0 +1,14 @@ +It looks like fregs.vregs[] is an array of double? +Casting to Dwarf_Word instead of & 0xFFFFFFF should do. + +--- a/backends/aarch64_initreg.c 2015-11-27 14:36:29.000000000 +0100 ++++ b/backends/aarch64_initreg.c 2016-08-09 03:47:25.428560159 +0200 +@@ -82,7 +82,7 @@ + + Dwarf_Word dwarf_fregs[32]; + for (int r = 0; r < 32; r++) +- dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF; ++ dwarf_fregs[r] = (Dwarf_Word)fregs.vregs[r]; + + if (! setfunc (64, 32, dwarf_fregs, arg)) + return false; diff --git a/repo/system/elfutils/patches/fix-uninitialized.patch b/repo/system/elfutils/patches/fix-uninitialized.patch new file mode 100644 index 0000000..31ecd9e --- /dev/null +++ b/repo/system/elfutils/patches/fix-uninitialized.patch @@ -0,0 +1,17 @@ + +--- a/libcpu/i386_disasm.c 2015-08-21 14:22:37.000000000 +0200 ++++ b/libcpu/i386_disasm.c 2015-11-20 06:30:59.250629957 +0100 +@@ -1,4 +1,4 @@ +-/* Disassembler for x86. ++/* Disassembler for x86. + Copyright (C) 2007, 2008, 2009, 2011 Red Hat, Inc. + This file is part of elfutils. + Written by Ulrich Drepper , 2007. +@@ -710,6 +710,7 @@ + + case 'm': + /* Mnemonic. */ ++ str = mnebuf; + + if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID)) + { diff --git a/repo/system/elfutils/patches/musl-asm-ptrace-h.patch b/repo/system/elfutils/patches/musl-asm-ptrace-h.patch new file mode 100644 index 0000000..fc14686 --- /dev/null +++ b/repo/system/elfutils/patches/musl-asm-ptrace-h.patch @@ -0,0 +1,10 @@ +--- a/backends/ppc_initreg.c 2019-11-26 23:48:42.000000000 +0100 ++++ b/backends/ppc_initreg.c 2019-12-08 16:57:58.334872602 +0100 +@@ -32,6 +32,7 @@ + + #include + #if defined(__powerpc__) && defined(__linux__) ++# include + # include + # include + #endif diff --git a/repo/system/elfutils/patches/musl-macros.patch b/repo/system/elfutils/patches/musl-macros.patch new file mode 100644 index 0000000..0d7ec41 --- /dev/null +++ b/repo/system/elfutils/patches/musl-macros.patch @@ -0,0 +1,87 @@ +--- a/src/arlib.h 2015-08-21 14:22:37.000000000 +0200 ++++ b/src/arlib.h 2015-11-20 08:02:55.153199611 +0100 +@@ -29,6 +29,16 @@ + #include + #include + ++#if !defined(ACCESSPERMS) ++# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */ ++#endif ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++#if !defined(DEFFILEMODE) ++# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/ ++#endif ++ + + /* State of -D/-U flags. */ + extern bool arlib_deterministic_output; +--- a/src/elfcompress.c.orig 2016-04-02 12:51:26.903848894 +0200 ++++ b/src/elfcompress.c 2016-04-02 12:55:15.076996338 +0200 +@@ -35,6 +35,14 @@ + #include + #include "system.h" + ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH 0 ++#endif ++ ++#if !defined(ALLPERMS) ++# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */ ++#endif ++ + /* Name and version of program. */ + static void print_version (FILE *stream, struct argp_state *state); + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; +diff --git a/lib/libeu.h b/lib/libeu.h +index 69fe3d7..e5c99b8 100644 +--- a/lib/libeu.h ++++ b/lib/libeu.h +@@ -31,6 +31,27 @@ + + #include + #include ++#include ++#include ++#include ++ ++#ifndef TEMP_FAILURE_RETRY ++#define TEMP_FAILURE_RETRY(expression) \ ++ (__extension__ \ ++ ({ long int __result; \ ++ do __result = (long int) (expression); \ ++ while (__result == -1L && errno == EINTR); \ ++ __result; })) ++#endif ++ ++#ifndef strndupa ++#define strndupa(s, n) \ ++ (__extension__ ({const char *__in = (s); \ ++ size_t __len = strnlen (__in, (n)) + 1; \ ++ char *__out = (char *) alloca (__len); \ ++ __out[__len-1] = '\0'; \ ++ (char *) memcpy (__out, __in, __len-1);})) ++#endif + + extern void *xmalloc (size_t) __attribute__ ((__malloc__)); + extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)); +diff --git a/src/strip.c b/src/strip.c +index 48792a7..d2f0c60 100644 +--- a/src/strip.c ++++ b/src/strip.c +@@ -46,6 +46,14 @@ + #include + #include + ++#if !defined(FNM_EXTMATCH) ++# define FNM_EXTMATCH 0 ++#endif ++ ++#if !defined(ACCESSPERMS) ++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) ++#endif ++ + typedef uint8_t GElf_Byte; + + /* Name and version of program. */ diff --git a/repo/system/elfutils/patches/musl-strndupa.patch b/repo/system/elfutils/patches/musl-strndupa.patch new file mode 100644 index 0000000..a520688 --- /dev/null +++ b/repo/system/elfutils/patches/musl-strndupa.patch @@ -0,0 +1,18 @@ +--- a/src/unstrip.c.orig 2017-04-27 14:26:26.000000000 +0000 ++++ b/src/unstrip.c 2017-05-05 15:51:33.515154220 +0000 +@@ -56,6 +56,15 @@ + # define _(str) gettext (str) + #endif + ++#ifndef strndupa ++#define strndupa(s, n) \ ++ (__extension__ ({const char *__in = (s); \ ++ size_t __len = strnlen (__in, (n)) + 1; \ ++ char *__out = (char *) alloca (__len); \ ++ __out[__len-1] = '\0'; \ ++ (char *) memcpy (__out, __in, __len-1);})) ++#endif ++ + /* Name and version of program. */ + ARGP_PROGRAM_VERSION_HOOK_DEF = print_version; + diff --git a/repo/system/elogind.xibuild b/repo/system/elogind.xibuild deleted file mode 100644 index c5f1774..0000000 --- a/repo/system/elogind.xibuild +++ /dev/null @@ -1,93 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make docbook4-xml docbook-xsl docbook-dtd libxslt util-linux glib acl m4" -DEPS="pam gperf eudev" - -PKG_VER=246.10 -SOURCE=https://github.com/elogind/elogind/archive/v$PKG_VER/elogind-$PKG_VER.tar.gz -ADDITIONAL=" -id-nobody.patch -mips.patch -ppc64-bad-tuple.patch -ppcle.patch -elogind.initd -" -DESC="The standalone logind daemon" - -prepare () { - sed -i '/Disable polkit/,+8 d' meson.build - - for p in *.patch; do - patch -Np1 -i $p - done - - # skip the check that the source tree is "too far" - # (the assert_cc line) - sed -i '83d' src/basic/log.h - - # remove -v options - sed -i 's/-v/-/g' tools/meson-symlink_headers.sh -} - -build () { - # TODO re-enable BUILD_MANS - meson \ - -Dcgroup-controller=elogind \ - -Dhalt-path=/sbin/halt \ - -Drootlibexecdir=/usr/libexec/elogind \ - -Dreboot-path=/sbin/reboot \ - -Ddefault-hierarchy=hybrid \ - -Ddefault-kill-user-processes=false \ - -Dpolkit=false \ - -Dman=false \ - build - - ninja -C build - -} - -package () { - DESTDIR="$PKG_DEST" meson install --no-rebuild -C build - - ln -sf libelogind.pc $PKG_DEST/usr/lib/pkgconfig/libsystemd.pc && - ln -sf elogind $PKG_DEST/usr/include/systemd - - install -Dm755 elogind.initd $PKG_DEST/etc/init.d/elogind - - - sed -e '/\[Login\]/a KillUserProcesses=no' \ - -i $PKG_DEST/etc/elogind/logind.conf - - cat >> $PKG_DEST/etc/pam.d/system-session << "EOF" && -# Begin elogind addition - -session required pam_loginuid.so -session optional pam_elogind.so - -# End elogind addition -EOF - cat > $PKG_DEST/etc/pam.d/elogind-user << "EOF" -# Begin /etc/pam.d/elogind-user - -account required pam_access.so -account include system-account - -session required pam_env.so -session required pam_limits.so -session required pam_unix.so -session required pam_loginuid.so -session optional pam_keyinit.so force revoke -session optional pam_elogind.so - -auth required pam_deny.so -password required pam_deny.so - -# End /etc/pam.d/elogind-user -EOF - - -} - -postinstall () { - rc-update add elogind -} diff --git a/repo/system/elogind/elogind.initd b/repo/system/elogind/elogind.initd new file mode 100644 index 0000000..0c22ca9 --- /dev/null +++ b/repo/system/elogind/elogind.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +supervisor=supervise-daemon + +name="System login manager" +description="System service that manages user logins" +description_reload="Reload configuration without exiting" + +command=/usr/libexec/elogind/elogind + +depend() { + need dbus + + # Make sure we start before any other display manager + before display-manager +} + +extra_started_commands="reload" + +reload() { + ebegin "Reloading configuration" + $supervisor $RC_SVCNAME --signal HUP + eend $? +} diff --git a/repo/system/elogind/elogind.xibuild b/repo/system/elogind/elogind.xibuild new file mode 100644 index 0000000..c5f1774 --- /dev/null +++ b/repo/system/elogind/elogind.xibuild @@ -0,0 +1,93 @@ +#!/bin/sh + +MAKEDEPS="make docbook4-xml docbook-xsl docbook-dtd libxslt util-linux glib acl m4" +DEPS="pam gperf eudev" + +PKG_VER=246.10 +SOURCE=https://github.com/elogind/elogind/archive/v$PKG_VER/elogind-$PKG_VER.tar.gz +ADDITIONAL=" +id-nobody.patch +mips.patch +ppc64-bad-tuple.patch +ppcle.patch +elogind.initd +" +DESC="The standalone logind daemon" + +prepare () { + sed -i '/Disable polkit/,+8 d' meson.build + + for p in *.patch; do + patch -Np1 -i $p + done + + # skip the check that the source tree is "too far" + # (the assert_cc line) + sed -i '83d' src/basic/log.h + + # remove -v options + sed -i 's/-v/-/g' tools/meson-symlink_headers.sh +} + +build () { + # TODO re-enable BUILD_MANS + meson \ + -Dcgroup-controller=elogind \ + -Dhalt-path=/sbin/halt \ + -Drootlibexecdir=/usr/libexec/elogind \ + -Dreboot-path=/sbin/reboot \ + -Ddefault-hierarchy=hybrid \ + -Ddefault-kill-user-processes=false \ + -Dpolkit=false \ + -Dman=false \ + build + + ninja -C build + +} + +package () { + DESTDIR="$PKG_DEST" meson install --no-rebuild -C build + + ln -sf libelogind.pc $PKG_DEST/usr/lib/pkgconfig/libsystemd.pc && + ln -sf elogind $PKG_DEST/usr/include/systemd + + install -Dm755 elogind.initd $PKG_DEST/etc/init.d/elogind + + + sed -e '/\[Login\]/a KillUserProcesses=no' \ + -i $PKG_DEST/etc/elogind/logind.conf + + cat >> $PKG_DEST/etc/pam.d/system-session << "EOF" && +# Begin elogind addition + +session required pam_loginuid.so +session optional pam_elogind.so + +# End elogind addition +EOF + cat > $PKG_DEST/etc/pam.d/elogind-user << "EOF" +# Begin /etc/pam.d/elogind-user + +account required pam_access.so +account include system-account + +session required pam_env.so +session required pam_limits.so +session required pam_unix.so +session required pam_loginuid.so +session optional pam_keyinit.so force revoke +session optional pam_elogind.so + +auth required pam_deny.so +password required pam_deny.so + +# End /etc/pam.d/elogind-user +EOF + + +} + +postinstall () { + rc-update add elogind +} diff --git a/repo/system/elogind/id-nobody.patch b/repo/system/elogind/id-nobody.patch new file mode 100644 index 0000000..5e9e5cd --- /dev/null +++ b/repo/system/elogind/id-nobody.patch @@ -0,0 +1,13 @@ +--- a/src/basic/user-util.h ++++ b/src/basic/user-util.h +@@ -70,8 +70,8 @@ int take_etc_passwd_lock(const char *root); + #define UID_INVALID ((uid_t) -1) + #define GID_INVALID ((gid_t) -1) + +-#define UID_NOBODY ((uid_t) 65534U) +-#define GID_NOBODY ((gid_t) 65534U) ++#define UID_NOBODY ((uid_t) 99U) ++#define GID_NOBODY ((gid_t) 99U) + + #define ETC_PASSWD_LOCK_PATH "/etc/.pwd.lock" + diff --git a/repo/system/elogind/mips.patch b/repo/system/elogind/mips.patch new file mode 100644 index 0000000..ca1c097 --- /dev/null +++ b/repo/system/elogind/mips.patch @@ -0,0 +1,11 @@ +--- a/src/basic/missing_syscall.h 2021-01-15 08:12:02.000000000 +0100 ++++ b/src/basic/missing_syscall.h 2021-02-24 07:20:32.026355819 +0100 +@@ -11,7 +11,7 @@ + #include + #include + +-#ifdef ARCH_MIPS ++#if defined(_MIPSEL) || defined(_MIPSEB) + #include + #endif + diff --git a/repo/system/elogind/ppc64-bad-tuple.patch b/repo/system/elogind/ppc64-bad-tuple.patch new file mode 100644 index 0000000..f6237ff --- /dev/null +++ b/repo/system/elogind/ppc64-bad-tuple.patch @@ -0,0 +1,25 @@ +From 0ce8ef86e8bfc872b40bc090fea9873fa1f51836 Mon Sep 17 00:00:00 2001 +From: q66 +Date: Thu, 21 Jan 2021 22:22:28 +0100 +Subject: [PATCH] fix ppc64 arch tuple + +--- + src/basic/architecture.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/basic/architecture.h src/basic/architecture.h +index 620b522..3ea6e52 100644 +--- a/src/basic/architecture.h ++++ b/src/basic/architecture.h +@@ -77,7 +77,7 @@ int uname_architecture(void); + #elif defined(__powerpc64__) + # if __BYTE_ORDER == __BIG_ENDIAN + # define native_architecture() ARCHITECTURE_PPC64 +-# define LIB_ARCH_TUPLE "ppc64-linux-gnu" ++# define LIB_ARCH_TUPLE "powerpc64-linux-gnu" + # define SECONDARY_ARCHITECTURE ARCHITECTURE_PPC + # else + # define native_architecture() ARCHITECTURE_PPC64_LE +-- +2.30.0 + diff --git a/repo/system/elogind/ppcle.patch b/repo/system/elogind/ppcle.patch new file mode 100644 index 0000000..b986b0f --- /dev/null +++ b/repo/system/elogind/ppcle.patch @@ -0,0 +1,25 @@ +From 836f3efb84a703b3594906572a54616d25cecf5e Mon Sep 17 00:00:00 2001 +From: q66 +Date: Thu, 21 Jan 2021 21:59:12 +0100 +Subject: [PATCH] add ppcle arch tuple + +--- + src/basic/architecture.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git src/basic/architecture.h src/basic/architecture.h +index 620b522..afdff7a 100644 +--- a/src/basic/architecture.h ++++ b/src/basic/architecture.h +@@ -94,7 +94,7 @@ int uname_architecture(void); + # endif + # else + # define native_architecture() ARCHITECTURE_PPC_LE +-# error "Missing LIB_ARCH_TUPLE for PPCLE" ++# define LIB_ARCH_TUPLE "powerpcle-linux-gnu" + # endif + #elif defined(__ia64__) + # define native_architecture() ARCHITECTURE_IA64 +-- +2.30.0 + diff --git a/repo/system/eudev.xibuild b/repo/system/eudev.xibuild deleted file mode 100644 index 983d112..0000000 --- a/repo/system/eudev.xibuild +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make autoconf automake" -DEPS="gperf udev-rules kmod" - -PKG_VER=3.2.10 -SOURCE=https://dev.gentoo.org/~blueness/eudev/eudev-$PKG_VER.tar.gz -DESC="Programs for dynamic creation of device nodes" -ADDITIONAL=" - default-rules.patch - load-fbcon.patch - udev.initd - udev_retry.initd -" - -prepare () { - #apply_patches - autoreconf -fiv - sed -i 's/\$(LN_S) -n -f/\$(LN_S) -f/' src/udev/Makefile.in -} - -build () { - ./configure --prefix=/usr \ - --bindir=/usr/sbin \ - --sbindir=/usr/sbin \ - --libexecdir=/usr/lib \ - --sysconfdir=/etc \ - --enable-manpages \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install - - install -Dm 754 udev.initd $PKG_DEST/etc/init.d/udev - install -Dm 754 udev_retry.initd $PKG_DEST/etc/init.d/udev_retry - mkdir -p $PKG_DEST/etc/runlevels/boot/ - ln -s /etc/init.d/udev $PKG_DEST/etc/runlevels/boot/udev - ln -s /etc/init.d/udev_retry $PKG_DEST/etc/runlevels/boot/udev_retry -} diff --git a/repo/system/eudev/default-rules.patch b/repo/system/eudev/default-rules.patch new file mode 100644 index 0000000..0786a98 --- /dev/null +++ b/repo/system/eudev/default-rules.patch @@ -0,0 +1,9 @@ +--- a/rules/50-udev-default.rules ++++ b/rules/50-udev-default.rules +@@ -73,5 +73,6 @@ KERNEL=="rfkill", MODE="0664" + KERNEL=="tun", MODE="0666", OPTIONS+="static_node=net/tun" + + KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse" ++KERNEL=="kvm", GROUP="kvm", MODE="0660" + + LABEL="default_end" diff --git a/repo/system/eudev/eudev.xibuild b/repo/system/eudev/eudev.xibuild new file mode 100644 index 0000000..983d112 --- /dev/null +++ b/repo/system/eudev/eudev.xibuild @@ -0,0 +1,41 @@ +#!/bin/sh + +MAKEDEPS="make autoconf automake" +DEPS="gperf udev-rules kmod" + +PKG_VER=3.2.10 +SOURCE=https://dev.gentoo.org/~blueness/eudev/eudev-$PKG_VER.tar.gz +DESC="Programs for dynamic creation of device nodes" +ADDITIONAL=" + default-rules.patch + load-fbcon.patch + udev.initd + udev_retry.initd +" + +prepare () { + #apply_patches + autoreconf -fiv + sed -i 's/\$(LN_S) -n -f/\$(LN_S) -f/' src/udev/Makefile.in +} + +build () { + ./configure --prefix=/usr \ + --bindir=/usr/sbin \ + --sbindir=/usr/sbin \ + --libexecdir=/usr/lib \ + --sysconfdir=/etc \ + --enable-manpages \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install + + install -Dm 754 udev.initd $PKG_DEST/etc/init.d/udev + install -Dm 754 udev_retry.initd $PKG_DEST/etc/init.d/udev_retry + mkdir -p $PKG_DEST/etc/runlevels/boot/ + ln -s /etc/init.d/udev $PKG_DEST/etc/runlevels/boot/udev + ln -s /etc/init.d/udev_retry $PKG_DEST/etc/runlevels/boot/udev_retry +} diff --git a/repo/system/eudev/load-fbcon.patch b/repo/system/eudev/load-fbcon.patch new file mode 100644 index 0000000..e5e404a --- /dev/null +++ b/repo/system/eudev/load-fbcon.patch @@ -0,0 +1,10 @@ +--- eudev-3.2.1/rules/80-drivers.rules.orig 2017-01-24 11:00:53.174192908 +0200 ++++ eudev-3.2.1/rules/80-drivers.rules 2017-01-24 11:04:01.886714118 +0200 +@@ -8,6 +8,7 @@ + SUBSYSTEM=="memstick", RUN{builtin}+="kmod load ms_block mspro_block" + SUBSYSTEM=="i2o", RUN{builtin}+="kmod load i2o_block" + SUBSYSTEM=="module", KERNEL=="parport_pc", RUN{builtin}+="kmod load ppdev" ++SUBSYSTEM=="graphics", RUN{builtin}+="kmod load fbcon" + KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN{builtin}+="kmod load sm_ftl" + + LABEL="drivers_end" diff --git a/repo/system/eudev/udev.initd b/repo/system/eudev/udev.initd new file mode 100644 index 0000000..5ce2354 --- /dev/null +++ b/repo/system/eudev/udev.initd @@ -0,0 +1,22 @@ +#!/sbin/openrc-run + +start () { + # Start the udev daemon to continually watch for, and act on, + # uevents + /sbin/udevd --daemon + + # Now traverse /sys in order to "coldplug" devices that have + # already been discovered + /sbin/udevadm trigger --action=add --type=subsystems + /sbin/udevadm trigger --action=add --type=devices + /sbin/udevadm trigger --action=change --type=devices + + # Now wait for udevd to process the uevents we triggered + if ! is_true "$OMIT_UDEV_SETTLE"; then + /sbin/udevadm settle + fi + + # If any LVM based partitions are on the system, ensure they + # are activated so they can be used. + if [ -x /sbin/vgchange ]; then /sbin/vgchange -a y >/dev/null; fi +} diff --git a/repo/system/eudev/udev_retry.initd b/repo/system/eudev/udev_retry.initd new file mode 100644 index 0000000..cfe077c --- /dev/null +++ b/repo/system/eudev/udev_retry.initd @@ -0,0 +1,31 @@ +#!/sbin/openrc-run +start () { + echo "Retrying failed uevents, if any..." + + # As of udev-186, the --run option is no longer valid + #rundir=$(/sbin/udevadm info --run) + rundir=/run/udev + # From Debian: "copy the rules generated before / was mounted + # read-write": + + for file in ${rundir}/tmp-rules--*; do + dest=${file##*tmp-rules--} + [ "$dest" = '*' ] && break + cat $file >> /etc/udev/rules.d/$dest + rm -f $file + done + + # Re-trigger the uevents that may have failed, + # in hope they will succeed now + /bin/sed -e 's/#.*$//' /etc/sysconfig/udev_retry | /bin/grep -v '^$' | \ + while read line ; do + for subsystem in $line ; do + /sbin/udevadm trigger --subsystem-match=$subsystem --action=add + done + done + + # Now wait for udevd to process the uevents we triggered + if ! is_true "$OMIT_UDEV_RETRY_SETTLE"; then + /sbin/udevadm settle + fi +} diff --git a/repo/system/execline.xibuild b/repo/system/execline.xibuild deleted file mode 100644 index 61d3e57..0000000 --- a/repo/system/execline.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="skalibs" - -PKG_VER=2.8.2.0 -SOURCE=https://skarnet.org/software/execline/execline-$PKG_VER.tar.gz -DESC="A non-interactive shell-like scripting language" - -build () { - ./configure --enable-shared \ - --enable-static \ - --enable-allstatic \ - --enable-static-libc \ - --libdir=/usr/lib \ - --with-dynlib=/usr/lib \ - --enable-pedantic-posix - - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/execline/execline.xibuild b/repo/system/execline/execline.xibuild new file mode 100644 index 0000000..61d3e57 --- /dev/null +++ b/repo/system/execline/execline.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="skalibs" + +PKG_VER=2.8.2.0 +SOURCE=https://skarnet.org/software/execline/execline-$PKG_VER.tar.gz +DESC="A non-interactive shell-like scripting language" + +build () { + ./configure --enable-shared \ + --enable-static \ + --enable-allstatic \ + --enable-static-libc \ + --libdir=/usr/lib \ + --with-dynlib=/usr/lib \ + --enable-pedantic-posix + + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/expat.xibuild b/repo/system/expat.xibuild deleted file mode 100644 index d921e1b..0000000 --- a/repo/system/expat.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.4.2 -SOURCE=https://github.com/libexpat/libexpat/releases/download/R_$(echo $PKG_VER | sed "s|\.|_|g")/expat-$PKG_VER.tar.xz -DESC="An XML parser library" - -build () { - ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/expat-$PKG_VER - make -} - -check () { - make check -} - -package () { - make DESTDIR=$PKG_DEST install - install -m644 doc/* $PKG_DEST/usr/share/doc/expat-$PKG_VER -} diff --git a/repo/system/expat/expat.xibuild b/repo/system/expat/expat.xibuild new file mode 100644 index 0000000..d921e1b --- /dev/null +++ b/repo/system/expat/expat.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.4.2 +SOURCE=https://github.com/libexpat/libexpat/releases/download/R_$(echo $PKG_VER | sed "s|\.|_|g")/expat-$PKG_VER.tar.xz +DESC="An XML parser library" + +build () { + ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/expat-$PKG_VER + make +} + +check () { + make check +} + +package () { + make DESTDIR=$PKG_DEST install + install -m644 doc/* $PKG_DEST/usr/share/doc/expat-$PKG_VER +} diff --git a/repo/system/findutils.xibuild b/repo/system/findutils.xibuild deleted file mode 100644 index 1dbc9d3..0000000 --- a/repo/system/findutils.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make sort" -DEPS="musl sh" - -PKG_VER=0.8.6 -SOURCE=http://landley.net/toybox/downloads/toybox-$PKG_VER.tar.gz -DESC="toybox utilities to locate files" - -build () { - make defconfig - make xargs - make find -} - -package () { - install -Dm755 find $PKG_DEST/usr/bin/find - install -Dm755 xargs $PKG_DEST/usr/bin/xargs -} diff --git a/repo/system/findutils/findutils.xibuild b/repo/system/findutils/findutils.xibuild new file mode 100644 index 0000000..1dbc9d3 --- /dev/null +++ b/repo/system/findutils/findutils.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make sort" +DEPS="musl sh" + +PKG_VER=0.8.6 +SOURCE=http://landley.net/toybox/downloads/toybox-$PKG_VER.tar.gz +DESC="toybox utilities to locate files" + +build () { + make defconfig + make xargs + make find +} + +package () { + install -Dm755 find $PKG_DEST/usr/bin/find + install -Dm755 xargs $PKG_DEST/usr/bin/xargs +} diff --git a/repo/system/freetype2.xibuild b/repo/system/freetype2.xibuild deleted file mode 100644 index b4a2571..0000000 --- a/repo/system/freetype2.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="brotli libpng which" - -PKG_VER=2.11.1 -SOURCE=https://downloads.sourceforge.net/freetype/freetype-$PKG_VER.tar.xz -DESC="Font rasterization library" - -prepare () { - sed -ri "s:.*(AUX_MODULES.*valid):\1:" modules.cfg && - - sed -r "s:.*(#.*SUBPIXEL_RENDERING) .*:\1:" \ - -i include/freetype/config/ftoption.h -} - -build () { - ./configure --prefix=/usr --enable-freetype-config --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/freetype2/freetype2.xibuild b/repo/system/freetype2/freetype2.xibuild new file mode 100644 index 0000000..b4a2571 --- /dev/null +++ b/repo/system/freetype2/freetype2.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="brotli libpng which" + +PKG_VER=2.11.1 +SOURCE=https://downloads.sourceforge.net/freetype/freetype-$PKG_VER.tar.xz +DESC="Font rasterization library" + +prepare () { + sed -ri "s:.*(AUX_MODULES.*valid):\1:" modules.cfg && + + sed -r "s:.*(#.*SUBPIXEL_RENDERING) .*:\1:" \ + -i include/freetype/config/ftoption.h +} + +build () { + ./configure --prefix=/usr --enable-freetype-config --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/fribidi.xibuild b/repo/system/fribidi.xibuild deleted file mode 100644 index ec3ea83..0000000 --- a/repo/system/fribidi.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -NAME="fribidi" -DESC="Free Implementation of the Unicode Bidirectional Algorithm" - -MAKEDEPS="meson ninja " -DEPS="musl " - -PKG_VER=1.0.11 -SOURCE="https://github.com/fribidi/fribidi/releases/download/v$PKG_VER/fribidi-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/fribidi/fribidi.xibuild b/repo/system/fribidi/fribidi.xibuild new file mode 100644 index 0000000..ec3ea83 --- /dev/null +++ b/repo/system/fribidi/fribidi.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +NAME="fribidi" +DESC="Free Implementation of the Unicode Bidirectional Algorithm" + +MAKEDEPS="meson ninja " +DEPS="musl " + +PKG_VER=1.0.11 +SOURCE="https://github.com/fribidi/fribidi/releases/download/v$PKG_VER/fribidi-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/gc.xibuild b/repo/system/gc.xibuild deleted file mode 100644 index bde408f..0000000 --- a/repo/system/gc.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="gcc" - -PKG_VER=8.0.6 -SOURCE=https://github.com/ivmai/bdwgc/releases/download/v$PKG_VER/gc-$PKG_VER.tar.gz -DESC="A garbage collector for C and C++" - -build () { - ./configure --prefix=/usr --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gc/gc.xibuild b/repo/system/gc/gc.xibuild new file mode 100644 index 0000000..bde408f --- /dev/null +++ b/repo/system/gc/gc.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="gcc" + +PKG_VER=8.0.6 +SOURCE=https://github.com/ivmai/bdwgc/releases/download/v$PKG_VER/gc-$PKG_VER.tar.gz +DESC="A garbage collector for C and C++" + +build () { + ./configure --prefix=/usr --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/gdbm.xibuild b/repo/system/gdbm.xibuild deleted file mode 100644 index 3906bbb..0000000 --- a/repo/system/gdbm.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl sh readline" - -PKG_VER=1.21 -SOURCE=https://ftp.gnu.org/gnu/gdbm/gdbm-$PKG_VER.tar.gz -DESC="GNU database library" - -build () { - ./configure --prefix=/usr --disable-static --enable-libgdm-compat - make -} - -check () { - make -k check || true -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gdbm/gdbm.xibuild b/repo/system/gdbm/gdbm.xibuild new file mode 100644 index 0000000..3906bbb --- /dev/null +++ b/repo/system/gdbm/gdbm.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl sh readline" + +PKG_VER=1.21 +SOURCE=https://ftp.gnu.org/gnu/gdbm/gdbm-$PKG_VER.tar.gz +DESC="GNU database library" + +build () { + ./configure --prefix=/usr --disable-static --enable-libgdm-compat + make +} + +check () { + make -k check || true +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/gettext.xibuild b/repo/system/gettext.xibuild deleted file mode 100644 index 11b6754..0000000 --- a/repo/system/gettext.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="acl sh" - -PKG_VER=0.3.2 -SOURCE=https://ftp.barfooze.de/pub/sabotage/tarballs/gettext-tiny-$PKG_VER.tar.xz -DESC="Lightweight replacement for tools used in the GNU gettext suite" - -ADDITIONAL=" - https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/line-length.patch - https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/respect-cflags.patch - https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/stop-doing-macro-crap.patch -" - -prepare () { - for p in *.patch; do - patch -Np1 -i $p || true - done -} - -build () { - LIBINTL=MUSL prefix=/usr make -} - -package () { - make LIBINTL=MUSL prefix=/usr DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gettext/gettext.xibuild b/repo/system/gettext/gettext.xibuild new file mode 100644 index 0000000..11b6754 --- /dev/null +++ b/repo/system/gettext/gettext.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="acl sh" + +PKG_VER=0.3.2 +SOURCE=https://ftp.barfooze.de/pub/sabotage/tarballs/gettext-tiny-$PKG_VER.tar.xz +DESC="Lightweight replacement for tools used in the GNU gettext suite" + +ADDITIONAL=" + https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/line-length.patch + https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/respect-cflags.patch + https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/patches/gettext-tiny-adiele/stop-doing-macro-crap.patch +" + +prepare () { + for p in *.patch; do + patch -Np1 -i $p || true + done +} + +build () { + LIBINTL=MUSL prefix=/usr make +} + +package () { + make LIBINTL=MUSL prefix=/usr DESTDIR=$PKG_DEST install +} diff --git a/repo/system/glew.xibuild b/repo/system/glew.xibuild deleted file mode 100644 index 7ad27fe..0000000 --- a/repo/system/glew.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -NAME="glew" -DESC="A cross-platform C/C++ extension loading library" - -MAKEDEPS="make " -DEPS="libxmu libxi mesa glu" - -PKG_VER=2.2.0 -SOURCE="https://downloads.sourceforge.net/glew/glew-$PKG_VER.tgz" -ADDITIONAL="glew.patch " - -build () { - make PREFIX=/usr -} - -package () { - mkdir -p $PKG_DEST/usr/lib64 - make PREFIX=/usr DESTDIR=$PKG_DEST install -} diff --git a/repo/system/glew/glew.patch b/repo/system/glew/glew.patch new file mode 100644 index 0000000..61c4447 --- /dev/null +++ b/repo/system/glew/glew.patch @@ -0,0 +1,34 @@ +Fixes pkg-config file to have correct system libdir. + +diff -aur glew-2.2.0/Makefile glew-2.2.0-alpine/Makefile +--- glew-2.2.0/Makefile 2020-03-15 11:53:59.000000000 +0000 ++++ glew-2.2.0-alpine/Makefile 2022-01-28 02:42:23.773580331 +0000 +@@ -144,7 +144,7 @@ + glew.pc: glew.pc.in + sed \ + -e "s|@prefix@|$(GLEW_PREFIX)|g" \ +- -e "s|@libdir@|$(LIBDIR)|g" \ ++ -e "s|@libdir@|/usr/lib|g" \ + -e "s|@exec_prefix@|$(BINDIR)|g" \ + -e "s|@includedir@|$(INCDIR)|g" \ + -e "s|@version@|$(GLEW_VERSION)|g" \ + +diff -aur glew-2.2.0/config/Makefile.linux glew-2.2.0-alpine/config/Makefile.linux +--- glew-2.2.0/config/Makefile.linux 2020-03-15 11:53:59.000000000 +0000 ++++ glew-2.2.0-alpine/config/Makefile.linux 2022-01-28 02:43:26.813582486 +0000 +@@ -12,13 +12,8 @@ + ifeq (e2k,${M_ARCH}) + ARCH64 = true + endif +-ifeq (${ARCH64},true) +- LDFLAGS.EXTRA = -L/usr/X11R6/lib64 -L/usr/lib64 +- LIBDIR = $(GLEW_DEST)/lib64 +-else +- LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib +- LIBDIR = $(GLEW_DEST)/lib +-endif ++LDFLAGS.EXTRA = -L/usr/X11R6/lib -L/usr/lib ++LIBDIR = $(GLEW_DEST)/lib + LDFLAGS.GL = -lGL -lX11 + LDFLAGS.STATIC = -Wl,-Bstatic + LDFLAGS.DYNAMIC = -Wl,-Bdynamic diff --git a/repo/system/glew/glew.xibuild b/repo/system/glew/glew.xibuild new file mode 100644 index 0000000..7ad27fe --- /dev/null +++ b/repo/system/glew/glew.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +NAME="glew" +DESC="A cross-platform C/C++ extension loading library" + +MAKEDEPS="make " +DEPS="libxmu libxi mesa glu" + +PKG_VER=2.2.0 +SOURCE="https://downloads.sourceforge.net/glew/glew-$PKG_VER.tgz" +ADDITIONAL="glew.patch " + +build () { + make PREFIX=/usr +} + +package () { + mkdir -p $PKG_DEST/usr/lib64 + make PREFIX=/usr DESTDIR=$PKG_DEST install +} diff --git a/repo/system/glib.xibuild b/repo/system/glib.xibuild deleted file mode 100644 index 870e600..0000000 --- a/repo/system/glib.xibuild +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -MAKEDEPS="meson ninja docbook-xsl docbook-dtd" -DEPS="pcre libffi zlib musl libxslt gdbm" - -PKG_VER=2.72.1 -SOURCE=https://download.gnome.org/sources/glib/$(echo $PKG_VER | cut -d. -f-2)/glib-$PKG_VER.tar.xz -DESC="Low level core library" -ADDITIONAL=" -0001-gquark-fix-initialization-with-c-constructors.patch -deprecated-no-warn.patch -musl-libintl.patch" - -prepare () { - apply_patches -} - -build () { - mkdir build && - cd build && - - meson --prefix=/usr \ - --buildtype=release \ - -Dman=false \ - .. && - ninja -} -package () { - DESTDIR=$PKG_DEST ninja install - mkdir -p $PKG_DEST/usr/share/doc/glib-$PKG_VER && - cp -r ../docs/reference/NEWS $PKG_DEST/usr/share/doc/glib-$PKG_VER - cp -r ../docs/reference/gio $PKG_DEST/usr/share/doc/glib-$PKG_VER - cp -r ../docs/reference/glib $PKG_DEST/usr/share/doc/glib-$PKG_VER - cp -r ../docs/reference/gobject $PKG_DEST/usr/share/doc/glib-$PKG_VER - -} diff --git a/repo/system/glib/0001-gquark-fix-initialization-with-c-constructors.patch b/repo/system/glib/0001-gquark-fix-initialization-with-c-constructors.patch new file mode 100644 index 0000000..50a9a8c --- /dev/null +++ b/repo/system/glib/0001-gquark-fix-initialization-with-c-constructors.patch @@ -0,0 +1,47 @@ +From e4216dee57f5156e192b2910f13eb855a104cb18 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 6 Jul 2016 12:38:40 +0200 +Subject: [PATCH] gquark: fix initialization with c++ constructors + +C++ constructors may want create new quarks, but we can not guarantee +that the glib library ctor is executed first. Therefore we make sure +that quarks are always initialized from g_quark_from_string and +g_quark_from_static_string + +This fixes crashes in glibmm with musl which likely happens on AIX too. + +https://bugzilla.gnome.org/show_bug.cgi?id=768215 +https://bugzilla.gnome.org/show_bug.cgi?id=756139#c14 +--- + glib/gquark.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/glib/gquark.c b/glib/gquark.c +index 9e51a92..17ecd7f 100644 +--- a/glib/gquark.c ++++ b/glib/gquark.c +@@ -57,6 +57,11 @@ static gint quark_block_offset = 0; + void + g_quark_init (void) + { ++ /* we may be initialized from c++ constructor or the glib ctor, but we ++ cannot guarantee in what order. So we check if we have been initialized */ ++ if (quark_ht != NULL) ++ return; ++ + g_assert (quark_seq_id == 0); + quark_ht = g_hash_table_new (g_str_hash, g_str_equal); + quarks = g_new (gchar*, QUARK_BLOCK_SIZE); +@@ -179,6 +184,9 @@ quark_from_string (const gchar *string, + { + GQuark quark = 0; + ++ if (G_UNLIKELY (quark_ht == NULL)) ++ g_quark_init(); ++ + quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string)); + + if (!quark) +-- +2.9.0 + diff --git a/repo/system/glib/deprecated-no-warn.patch b/repo/system/glib/deprecated-no-warn.patch new file mode 100644 index 0000000..e247eca --- /dev/null +++ b/repo/system/glib/deprecated-no-warn.patch @@ -0,0 +1,23 @@ +diff -Naur a/gio/glib-compile-schemas.c b/gio/glib-compile-schemas.c +--- a/gio/glib-compile-schemas.c 2018-09-21 15:23:52.000000000 +0100 ++++ b/gio/glib-compile-schemas.c 2019-02-10 14:37:30.034879344 +0000 +@@ -1233,19 +1233,6 @@ + return; + } + +- if (path && (g_str_has_prefix (path, "/apps/") || +- g_str_has_prefix (path, "/desktop/") || +- g_str_has_prefix (path, "/system/"))) +- { +- gchar *message = NULL; +- message = g_strdup_printf (_("Warning: Schema “%s” has path “%s”. " +- "Paths starting with " +- "“/apps/”, “/desktop/” or “/system/” are deprecated."), +- id, path); +- g_printerr ("%s\n", message); +- g_free (message); +- } +- + state->schema_state = schema_state_new (path, gettext_domain, + extends, extends_name, list_of); + diff --git a/repo/system/glib/glib.xibuild b/repo/system/glib/glib.xibuild new file mode 100644 index 0000000..870e600 --- /dev/null +++ b/repo/system/glib/glib.xibuild @@ -0,0 +1,36 @@ +#!/bin/sh + +MAKEDEPS="meson ninja docbook-xsl docbook-dtd" +DEPS="pcre libffi zlib musl libxslt gdbm" + +PKG_VER=2.72.1 +SOURCE=https://download.gnome.org/sources/glib/$(echo $PKG_VER | cut -d. -f-2)/glib-$PKG_VER.tar.xz +DESC="Low level core library" +ADDITIONAL=" +0001-gquark-fix-initialization-with-c-constructors.patch +deprecated-no-warn.patch +musl-libintl.patch" + +prepare () { + apply_patches +} + +build () { + mkdir build && + cd build && + + meson --prefix=/usr \ + --buildtype=release \ + -Dman=false \ + .. && + ninja +} +package () { + DESTDIR=$PKG_DEST ninja install + mkdir -p $PKG_DEST/usr/share/doc/glib-$PKG_VER && + cp -r ../docs/reference/NEWS $PKG_DEST/usr/share/doc/glib-$PKG_VER + cp -r ../docs/reference/gio $PKG_DEST/usr/share/doc/glib-$PKG_VER + cp -r ../docs/reference/glib $PKG_DEST/usr/share/doc/glib-$PKG_VER + cp -r ../docs/reference/gobject $PKG_DEST/usr/share/doc/glib-$PKG_VER + +} diff --git a/repo/system/glib/musl-libintl.patch b/repo/system/glib/musl-libintl.patch new file mode 100644 index 0000000..a673800 --- /dev/null +++ b/repo/system/glib/musl-libintl.patch @@ -0,0 +1,22 @@ +diff --git a/meson.build b/meson.build +index 319f183..3a5fdfc 100644 +--- a/meson.build ++++ b/meson.build +@@ -2047,9 +2047,6 @@ endif + # FIXME: glib-gettext.m4 has much more checks to detect broken/uncompatible + # implementations. This could be extended if issues are found in some platforms. + libintl_deps = [] +-if cc.has_function('ngettext') +- have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset') +-else + # First just find the bare library. + libintl = cc.find_library('intl', required : false) + # The bare library probably won't link without help if it's static. +@@ -2081,7 +2078,6 @@ else + have_bind_textdomain_codeset = cc.has_function('bind_textdomain_codeset', args : osx_ldflags, + dependencies : libintl_deps) + endif +-endif + + glib_conf.set('HAVE_BIND_TEXTDOMAIN_CODESET', have_bind_textdomain_codeset) + diff --git a/repo/system/glm.xibuild b/repo/system/glm.xibuild deleted file mode 100644 index cd918c3..0000000 --- a/repo/system/glm.xibuild +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/sh - -NAME="glm" -DESC="C++ mathematics library for graphics programming" - -MAKEDEPS="cmake " -DEPS="musl " - -PKG_VER=0.9.9.8 -SOURCE="https://github.com/g-truc/glm/archive/refs/tags/$PKG_VER/glm-$PKG_VER.tar.gz" -ADDITIONAL=" -fix-endian-test.patch -glm.pc -" - -build () { - cmake -B build -G Ninja \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=/usr/lib \ - -DBUILD_SHARED_LIBS=True \ - -DBUILD_STATIC_LIBS=OFF - cmake --build build -} - -package () { - - mkdir -p $PKG_DEST/usr/include/ - cp -r glm $PKG_DEST/usr/include/ - - mkdir -p $PKG_DEST/usr/share/doc/ - cp -r doc $PKG_DEST/usr/share/doc/glm - - mkdir -p $PKG_DEST/usr/lib/pkgconfig - cp glm.pc $PKG_DEST/usr/lib/pkgconfig/ -} diff --git a/repo/system/glm/fix-endian-test.patch b/repo/system/glm/fix-endian-test.patch new file mode 100644 index 0000000..ba2cce4 --- /dev/null +++ b/repo/system/glm/fix-endian-test.patch @@ -0,0 +1,30 @@ +diff --git a/test/gtc/gtc_packing.cpp b/test/gtc/gtc_packing.cpp +index 5830999..86167c5 100644 +--- a/test/gtc/gtc_packing.cpp ++++ b/test/gtc/gtc_packing.cpp +@@ -5,6 +5,8 @@ + #include + #include + ++#include ++ + void print_bits(float const& s) + { + union +@@ -154,6 +156,7 @@ int test_U3x10_1x2() + Error += glm::all(glm::equal(v0, v1)) ? 0 : 1; + } + ++#if BYTE_ORDER == LITTLE_ENDIAN + glm::u8vec4 const v0(0xff, 0x77, 0x0, 0x33); + glm::uint32 const p0 = *reinterpret_cast(&v0[0]); + glm::uint32 const r0 = 0x330077ff; +@@ -165,7 +168,7 @@ int test_U3x10_1x2() + glm::uint32 const r1 = 0xc001dcff; + + Error += p1 == r1 ? 0 : 1; +- ++#endif + return Error; + } + diff --git a/repo/system/glm/glm.pc b/repo/system/glm/glm.pc new file mode 100644 index 0000000..e3bb5ac --- /dev/null +++ b/repo/system/glm/glm.pc @@ -0,0 +1,7 @@ +prefix=/usr +includedir=${prefix}/include + +Name: GLM +Description: OpenGL Mathematics +Version: 0.9.9 +Cflags: -I${includedir} diff --git a/repo/system/glm/glm.xibuild b/repo/system/glm/glm.xibuild new file mode 100644 index 0000000..cd918c3 --- /dev/null +++ b/repo/system/glm/glm.xibuild @@ -0,0 +1,35 @@ +#!/bin/sh + +NAME="glm" +DESC="C++ mathematics library for graphics programming" + +MAKEDEPS="cmake " +DEPS="musl " + +PKG_VER=0.9.9.8 +SOURCE="https://github.com/g-truc/glm/archive/refs/tags/$PKG_VER/glm-$PKG_VER.tar.gz" +ADDITIONAL=" +fix-endian-test.patch +glm.pc +" + +build () { + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DBUILD_SHARED_LIBS=True \ + -DBUILD_STATIC_LIBS=OFF + cmake --build build +} + +package () { + + mkdir -p $PKG_DEST/usr/include/ + cp -r glm $PKG_DEST/usr/include/ + + mkdir -p $PKG_DEST/usr/share/doc/ + cp -r doc $PKG_DEST/usr/share/doc/glm + + mkdir -p $PKG_DEST/usr/lib/pkgconfig + cp glm.pc $PKG_DEST/usr/lib/pkgconfig/ +} diff --git a/repo/system/glu.xibuild b/repo/system/glu.xibuild deleted file mode 100644 index 54249a7..0000000 --- a/repo/system/glu.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -NAME="glu" -DESC="Mesa OpenGL Utility library" - -MAKEDEPS="meson ninja " -DEPS="mesa opengl" - -PKG_VER=9.0.2 -SOURCE="https://mesa.freedesktop.org/archive/glu/glu-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - -D default_library=shared \ - -D gl_provider=osmesa \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/glu/glu.xibuild b/repo/system/glu/glu.xibuild new file mode 100644 index 0000000..54249a7 --- /dev/null +++ b/repo/system/glu/glu.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +NAME="glu" +DESC="Mesa OpenGL Utility library" + +MAKEDEPS="meson ninja " +DEPS="mesa opengl" + +PKG_VER=9.0.2 +SOURCE="https://mesa.freedesktop.org/archive/glu/glu-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + -D default_library=shared \ + -D gl_provider=osmesa \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/gmp.xibuild b/repo/system/gmp.xibuild deleted file mode 100644 index 0bfd3f4..0000000 --- a/repo/system/gmp.xibuild +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make perl" -DEPS="sh procps-ng" - -PKG_VER=6.2.1 -SOURCE=https://gmplib.org/download/gmp/gmp-$PKG_VER.tar.xz -DESC="a collection of mathematical libraries" - -prepare () { - cp configfsf.guess config.guess - cp configfsf.sub config.sub -} - -build () { - - ./configure --prefix=/usr --enable-cxx --disable-static --docdir=/usr/share/doc/gmp - - make - make html -} - -check () { - make check 2>&1 | tee gmp-check-log - awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log -} - -package() { - make DESTDIR=$PKG_DEST install - make DESTDIR=$PKG_DEST install-html -} diff --git a/repo/system/gmp/gmp.xibuild b/repo/system/gmp/gmp.xibuild new file mode 100644 index 0000000..0bfd3f4 --- /dev/null +++ b/repo/system/gmp/gmp.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +MAKEDEPS="make perl" +DEPS="sh procps-ng" + +PKG_VER=6.2.1 +SOURCE=https://gmplib.org/download/gmp/gmp-$PKG_VER.tar.xz +DESC="a collection of mathematical libraries" + +prepare () { + cp configfsf.guess config.guess + cp configfsf.sub config.sub +} + +build () { + + ./configure --prefix=/usr --enable-cxx --disable-static --docdir=/usr/share/doc/gmp + + make + make html +} + +check () { + make check 2>&1 | tee gmp-check-log + awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log +} + +package() { + make DESTDIR=$PKG_DEST install + make DESTDIR=$PKG_DEST install-html +} diff --git a/repo/system/gnutls.xibuild b/repo/system/gnutls.xibuild deleted file mode 100644 index 20160e4..0000000 --- a/repo/system/gnutls.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="libtasn1 readline zlib nettle libp11-kit libidn libunistring" - -PKG_VER=3.6.16 -SOURCE=https://www.gnupg.org/ftp/gcrypt/gnutls/v$(echo $PKG_VER | cut -d. -f-2)/gnutls-$PKG_VER.tar.xz -DESC="Library which provides a secure layer over a transport layer" - -build () { - - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gnutls/gnutls.xibuild b/repo/system/gnutls/gnutls.xibuild new file mode 100644 index 0000000..20160e4 --- /dev/null +++ b/repo/system/gnutls/gnutls.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="libtasn1 readline zlib nettle libp11-kit libidn libunistring" + +PKG_VER=3.6.16 +SOURCE=https://www.gnupg.org/ftp/gcrypt/gnutls/v$(echo $PKG_VER | cut -d. -f-2)/gnutls-$PKG_VER.tar.xz +DESC="Library which provides a secure layer over a transport layer" + +build () { + + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/gobject-introspection.xibuild b/repo/system/gobject-introspection.xibuild deleted file mode 100644 index 5d5a117..0000000 --- a/repo/system/gobject-introspection.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="meson ninja patch flex" -DEPS="python-mako python-markdown glib" - -PKG_VER=1.72.0 -SOURCE=https://download.gnome.org/sources/gobject-introspection/$(echo $PKG_VER | cut -d. -f-2)/gobject-introspection-$PKG_VER.tar.xz - -ADDITIONAL="musl-time64.patch" -DESC="Introspection system for GObject-based libraries" - -prepare () { - apply_patches -} - -build () { - mkdir build && - cd build - - meson --prefix=/usr --buildtype=release .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/gobject-introspection/gobject-introspection.xibuild b/repo/system/gobject-introspection/gobject-introspection.xibuild new file mode 100644 index 0000000..5d5a117 --- /dev/null +++ b/repo/system/gobject-introspection/gobject-introspection.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="meson ninja patch flex" +DEPS="python-mako python-markdown glib" + +PKG_VER=1.72.0 +SOURCE=https://download.gnome.org/sources/gobject-introspection/$(echo $PKG_VER | cut -d. -f-2)/gobject-introspection-$PKG_VER.tar.xz + +ADDITIONAL="musl-time64.patch" +DESC="Introspection system for GObject-based libraries" + +prepare () { + apply_patches +} + +build () { + mkdir build && + cd build + + meson --prefix=/usr --buildtype=release .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/gobject-introspection/musl-time64.patch b/repo/system/gobject-introspection/musl-time64.patch new file mode 100644 index 0000000..9990efd --- /dev/null +++ b/repo/system/gobject-introspection/musl-time64.patch @@ -0,0 +1,37 @@ +--- a/giscanner/ast.py 2022-03-18 11:54:42.318927500 +0000 ++++ b/giscanner/ast.py 2022-03-18 11:54:42.318927500 +0000 +@@ -346,7 +346,7 @@ + type_names['ssize_t'] = type_names['gssize'] + type_names['uintptr_t'] = type_names['guintptr'] + type_names['intptr_t'] = type_names['gintptr'] +-type_names['time_t'] = TYPE_LONG ++type_names['time_t'] = TYPE_INT64 + type_names['off_t'] = type_names['gsize'] + type_names['pid_t'] = TYPE_INT + type_names['uid_t'] = TYPE_UINT +--- a/tests/scanner/Regress-1.0-expected.gir 2022-03-18 11:54:42.318927500 +0000 ++++ b/tests/scanner/Regress-1.0-expected.gir 2022-03-18 11:54:42.318927500 +0000 +@@ -2023,7 +2023,7 @@ + + + +- ++ + + + +@@ -8569,7 +8569,7 @@ + + + +- ++ + + + +@@ -8576,4 +8576,4 @@ +- ++ + + + diff --git a/repo/system/gperf.xibuild b/repo/system/gperf.xibuild deleted file mode 100644 index eebb471..0000000 --- a/repo/system/gperf.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=3.1 -SOURCE=http://ftp.gnu.org/pub/gnu/gperf/gperf-$PKG_VER.tar.gz -DESC="Perfect hash function generator" - -build () { - ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-$PKG_VER - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gperf/gperf.xibuild b/repo/system/gperf/gperf.xibuild new file mode 100644 index 0000000..eebb471 --- /dev/null +++ b/repo/system/gperf/gperf.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=3.1 +SOURCE=http://ftp.gnu.org/pub/gnu/gperf/gperf-$PKG_VER.tar.gz +DESC="Perfect hash function generator" + +build () { + ./configure --prefix=/usr --docdir=/usr/share/doc/gperf-$PKG_VER + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/grub.xibuild b/repo/system/grub.xibuild deleted file mode 100644 index 343c07e..0000000 --- a/repo/system/grub.xibuild +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="sh xz gettext device-mapper efibootmgr freetype2" - -PKG_VER=2.06 -SOURCE=https://ftp.gnu.org/gnu/grub/grub-$PKG_VER.tar.xz -ADDITIONAL=" - https://unifoundry.com/pub/unifont/unifont-13.0.06/font-builds/unifont-13.0.06.pcf.gz - " - - -DESC="GNU GRand Unified Bootloader v2" - -prepare () { - gunzip -c unifont-13.0.06.pcf.gz > $PKG_DEST/usr/share/fonts/unifont/unifont.pcf - - unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS -} - -build () { - ./configure --prefix=/usr --sysconfdir=/etc --disable-werror \ - --disable-efiemu --enable-grub-mkfont --with-platform=efi - make -} - -package () { - make DESTDIR=$PKG_DEST install - mkdir -p $PKG_DEST/usr/share/bash-completion/completions - mv $PKG_DEST/etc/bash_completion.d/grub $PKG_DEST/usr/share/bash-completion/completions - mkdir -p $PKG_DEST/etc/default - cat > $PKG_DEST/etc/default/grub << "EOF" -# GRUB boot loader configuration - -GRUB_DEFAULT=0 -GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="XiLinux" - -GRUB_CMDLINE_LINUX_DEFAULT="" -GRUB_CMDLINE_LINUX="" - -EOF -} diff --git a/repo/system/grub/grub.xibuild b/repo/system/grub/grub.xibuild new file mode 100644 index 0000000..343c07e --- /dev/null +++ b/repo/system/grub/grub.xibuild @@ -0,0 +1,43 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="sh xz gettext device-mapper efibootmgr freetype2" + +PKG_VER=2.06 +SOURCE=https://ftp.gnu.org/gnu/grub/grub-$PKG_VER.tar.xz +ADDITIONAL=" + https://unifoundry.com/pub/unifont/unifont-13.0.06/font-builds/unifont-13.0.06.pcf.gz + " + + +DESC="GNU GRand Unified Bootloader v2" + +prepare () { + gunzip -c unifont-13.0.06.pcf.gz > $PKG_DEST/usr/share/fonts/unifont/unifont.pcf + + unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS +} + +build () { + ./configure --prefix=/usr --sysconfdir=/etc --disable-werror \ + --disable-efiemu --enable-grub-mkfont --with-platform=efi + make +} + +package () { + make DESTDIR=$PKG_DEST install + mkdir -p $PKG_DEST/usr/share/bash-completion/completions + mv $PKG_DEST/etc/bash_completion.d/grub $PKG_DEST/usr/share/bash-completion/completions + mkdir -p $PKG_DEST/etc/default + cat > $PKG_DEST/etc/default/grub << "EOF" +# GRUB boot loader configuration + +GRUB_DEFAULT=0 +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="XiLinux" + +GRUB_CMDLINE_LINUX_DEFAULT="" +GRUB_CMDLINE_LINUX="" + +EOF +} diff --git a/repo/system/guile.xibuild b/repo/system/guile.xibuild deleted file mode 100644 index 5873f37..0000000 --- a/repo/system/guile.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="gmp libtool ncurses texinfo libunistring gc libffi" - - -PKG_VER=2.2.7 -SOURCE=https://ftp.gnu.org/gnu/guile/guile-$PKG_VER.tar.gz -DESC="Portable, embeddable Scheme implementation written in C" - -build () { - ./autogen.sh - ./configure --prefix=/usr --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/guile/guile.xibuild b/repo/system/guile/guile.xibuild new file mode 100644 index 0000000..5873f37 --- /dev/null +++ b/repo/system/guile/guile.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="gmp libtool ncurses texinfo libunistring gc libffi" + + +PKG_VER=2.2.7 +SOURCE=https://ftp.gnu.org/gnu/guile/guile-$PKG_VER.tar.gz +DESC="Portable, embeddable Scheme implementation written in C" + +build () { + ./autogen.sh + ./configure --prefix=/usr --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/gzip.xibuild b/repo/system/gzip.xibuild deleted file mode 100644 index 8e3c78a..0000000 --- a/repo/system/gzip.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl sh less" - -PKG_VER=1.11 -SOURCE=https://ftp.gnu.org/gnu/gzip/gzip-$PKG_VER.tar.xz -DESC="GNU compression utilities" - -build () { - ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/gzip/gzip.xibuild b/repo/system/gzip/gzip.xibuild new file mode 100644 index 0000000..8e3c78a --- /dev/null +++ b/repo/system/gzip/gzip.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl sh less" + +PKG_VER=1.11 +SOURCE=https://ftp.gnu.org/gnu/gzip/gzip-$PKG_VER.tar.xz +DESC="GNU compression utilities" + +build () { + ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/hwids.xibuild b/repo/system/hwids.xibuild deleted file mode 100644 index 1cd6827..0000000 --- a/repo/system/hwids.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make eudev" -DEPS="" - -PKG_VER=20210613 -SOURCE=https://github.com/gentoo/hwids/archive/hwids-$PKG_VER.tar.gz -DESC="Hardware Identification databases" - -prepare () { - sed -i "s/install -p/install/g" Makefile -} - -build () { - make UDEV=yes -} - -package () { - make DESTDIR=$PKG_DEST DOCDIR="/usr/share/doc/hwids-$PKG_VER" MISCDIR="/usr/share/hwdata" UDEV=yes install -} diff --git a/repo/system/hwids/hwids.xibuild b/repo/system/hwids/hwids.xibuild new file mode 100644 index 0000000..1cd6827 --- /dev/null +++ b/repo/system/hwids/hwids.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make eudev" +DEPS="" + +PKG_VER=20210613 +SOURCE=https://github.com/gentoo/hwids/archive/hwids-$PKG_VER.tar.gz +DESC="Hardware Identification databases" + +prepare () { + sed -i "s/install -p/install/g" Makefile +} + +build () { + make UDEV=yes +} + +package () { + make DESTDIR=$PKG_DEST DOCDIR="/usr/share/doc/hwids-$PKG_VER" MISCDIR="/usr/share/hwdata" UDEV=yes install +} diff --git a/repo/system/iana-etc.xibuild b/repo/system/iana-etc.xibuild deleted file mode 100644 index 812ed14..0000000 --- a/repo/system/iana-etc.xibuild +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -MAKEDEPS="" -DEPS="" - -PKG_VER=20210611 -SOURCE=https://github.com/Mic92/iana-etc/releases/download/$PKG_VER/iana-etc-$PKG_VER.tar.gz -DESC="A set of data from the internet assigned numbers authority providing data for network services and protocols" - -package () { - mkdir -p $PKG_DEST/etc - cp protocols $PKG_DEST/etc/ - cp services $PKG_DEST/etc/ -} - diff --git a/repo/system/iana-etc/iana-etc.xibuild b/repo/system/iana-etc/iana-etc.xibuild new file mode 100644 index 0000000..812ed14 --- /dev/null +++ b/repo/system/iana-etc/iana-etc.xibuild @@ -0,0 +1,15 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="" + +PKG_VER=20210611 +SOURCE=https://github.com/Mic92/iana-etc/releases/download/$PKG_VER/iana-etc-$PKG_VER.tar.gz +DESC="A set of data from the internet assigned numbers authority providing data for network services and protocols" + +package () { + mkdir -p $PKG_DEST/etc + cp protocols $PKG_DEST/etc/ + cp services $PKG_DEST/etc/ +} + diff --git a/repo/system/icu.xibuild b/repo/system/icu.xibuild deleted file mode 100644 index 0d8d798..0000000 --- a/repo/system/icu.xibuild +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -MAKEDEPS="python" -DEPS="bash" - -PKG_VER=71.1 -SOURCE=https://github.com/unicode-org/icu/releases/download/release-$(echo $PKG_VER | sed 's/\./-/g')/icu4c-$(echo $PKG_VER | sed 's/\./_/g')-src.tgz -DESC="International Components for Unicode library" -ADDITIONAL=" -fix-ucptrietest-golden-diff.patch -" - -prepare () { - cd source - autoreconf -fi - sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' configure -} - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --with-data-packaging=library \ - --disable-samples \ - --mandir=/usr/share/man - - mkdir -p data/out - make - -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/icu/fix-ucptrietest-golden-diff.patch b/repo/system/icu/fix-ucptrietest-golden-diff.patch new file mode 100644 index 0000000..1b8082e --- /dev/null +++ b/repo/system/icu/fix-ucptrietest-golden-diff.patch @@ -0,0 +1,33 @@ +Patch-Source: https://github.com/unicode-org/icu/pull/1925 +Subject: [PATCH] ICU-21793 Fix ucptrietest golden diff + +diff --git a/icu4c/source/tools/toolutil/toolutil.cpp b/icu4c/source/tools/toolutil/toolutil.cpp +index 1fc68aa69c8..a9dc37377a8 100644 +--- a/tools/toolutil/toolutil.cpp ++++ b/tools/toolutil/toolutil.cpp +@@ -228,18 +228,19 @@ uprv_compareGoldenFiles( + std::ifstream ifs(goldenFilePath, std::ifstream::in); + int32_t pos = 0; + char c; +- while ((c = ifs.get()) != std::char_traits::eof() && pos < bufferLen) { ++ while (ifs.get(c) && pos < bufferLen) { + if (c != buffer[pos]) { + // Files differ at this position +- return pos; ++ break; + } + pos++; + } +- if (pos < bufferLen || c != std::char_traits::eof()) { +- // Files are different lengths +- return pos; ++ if (pos == bufferLen && ifs.eof()) { ++ // Files are same lengths ++ pos = -1; + } +- return -1; ++ ifs.close(); ++ return pos; + } + + /*U_CAPI UDate U_EXPORT2 diff --git a/repo/system/icu/icu.xibuild b/repo/system/icu/icu.xibuild new file mode 100644 index 0000000..0d8d798 --- /dev/null +++ b/repo/system/icu/icu.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +MAKEDEPS="python" +DEPS="bash" + +PKG_VER=71.1 +SOURCE=https://github.com/unicode-org/icu/releases/download/release-$(echo $PKG_VER | sed 's/\./-/g')/icu4c-$(echo $PKG_VER | sed 's/\./_/g')-src.tgz +DESC="International Components for Unicode library" +ADDITIONAL=" +fix-ucptrietest-golden-diff.patch +" + +prepare () { + cd source + autoreconf -fi + sed -i -e 's,DU_HAVE_STRTOD_L=1,DU_HAVE_STRTOD_L=0,' configure +} + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --with-data-packaging=library \ + --disable-samples \ + --mandir=/usr/share/man + + mkdir -p data/out + make + +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/imlib2.xibuild b/repo/system/imlib2.xibuild deleted file mode 100644 index 9ed5b15..0000000 --- a/repo/system/imlib2.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="tiff giflib bzip2 freetype2 libxext libpng libid3tag libjpeg-turbo libwebp libheif librsvg xz" - -PKG_VER=1.8.0 -SOURCE=https://downloads.sourceforge.net/enlightenment/imlib2-$PKG_VER.tar.xz -DESC="Graphics library for fast file loading, saving, rendering and manipulation" - -build () { - ./configure --prefix=/usr --disable-static && - make - -} - -package () { - make DESTDIR=$PKG_DEST install - install -m755 -d /usr/share/doc/imlib2-$PKG_VER && - install -m644 doc/index.html /usr/share/doc/imlib2-$PKG_VER - install -m644 doc/*.gif /usr/share/doc/imlib2-$PKG_VER - -} diff --git a/repo/system/imlib2/imlib2.xibuild b/repo/system/imlib2/imlib2.xibuild new file mode 100644 index 0000000..9ed5b15 --- /dev/null +++ b/repo/system/imlib2/imlib2.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="tiff giflib bzip2 freetype2 libxext libpng libid3tag libjpeg-turbo libwebp libheif librsvg xz" + +PKG_VER=1.8.0 +SOURCE=https://downloads.sourceforge.net/enlightenment/imlib2-$PKG_VER.tar.xz +DESC="Graphics library for fast file loading, saving, rendering and manipulation" + +build () { + ./configure --prefix=/usr --disable-static && + make + +} + +package () { + make DESTDIR=$PKG_DEST install + install -m755 -d /usr/share/doc/imlib2-$PKG_VER && + install -m644 doc/index.html /usr/share/doc/imlib2-$PKG_VER + install -m644 doc/*.gif /usr/share/doc/imlib2-$PKG_VER + +} diff --git a/repo/system/intltool.xibuild b/repo/system/intltool.xibuild deleted file mode 100644 index aee502e..0000000 --- a/repo/system/intltool.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="perl-xml-parser" - -PKG_VER=0.51.0 -SOURCE=https://launchpad.net/intltool/trunk/$PKG_VER/+download/intltool-$PKG_VER.tar.gz -DESC="The internationalization tool collection" - -build () { - ./configure --prefix=/usr - make -} - -#skip running testsuite due to incompatible cmp -#check () { - #make check -#} - -package () { - make DESTDIR=$PKG_DEST install - install -Dm644 doc/I18N-HOWTO $PKG_DEST/usr/share/doc/intltool-$PKG_VER/I18N-HOWTO -} diff --git a/repo/system/intltool/intltool.xibuild b/repo/system/intltool/intltool.xibuild new file mode 100644 index 0000000..aee502e --- /dev/null +++ b/repo/system/intltool/intltool.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="perl-xml-parser" + +PKG_VER=0.51.0 +SOURCE=https://launchpad.net/intltool/trunk/$PKG_VER/+download/intltool-$PKG_VER.tar.gz +DESC="The internationalization tool collection" + +build () { + ./configure --prefix=/usr + make +} + +#skip running testsuite due to incompatible cmp +#check () { + #make check +#} + +package () { + make DESTDIR=$PKG_DEST install + install -Dm644 doc/I18N-HOWTO $PKG_DEST/usr/share/doc/intltool-$PKG_VER/I18N-HOWTO +} diff --git a/repo/system/jansson.xibuild b/repo/system/jansson.xibuild deleted file mode 100644 index 9f82843..0000000 --- a/repo/system/jansson.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.14 -SOURCE=https://github.com/akheron/jansson/releases/download/v$PKG_VER/jansson-$PKG_VER.tar.gz - -DESC="Library for encoding, decoding and manipulating JSON data" - -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/system/jansson/jansson.xibuild b/repo/system/jansson/jansson.xibuild new file mode 100644 index 0000000..9f82843 --- /dev/null +++ b/repo/system/jansson/jansson.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.14 +SOURCE=https://github.com/akheron/jansson/releases/download/v$PKG_VER/jansson-$PKG_VER.tar.gz + +DESC="Library for encoding, decoding and manipulating JSON data" + +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/system/js78.xibuild b/repo/system/js78.xibuild deleted file mode 100644 index 199740a..0000000 --- a/repo/system/js78.xibuild +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -MAKEDEPS="gcc autoconf2-13 icu rustc zlib which zip clang llvm patch make python-six python-mach" -DEPS="readline nspr bash zlib" - -PKG_VER=78.15.0 -SOURCE=https://archive.mozilla.org/pub/firefox/releases/${PKG_VER}esr/source/firefox-${PKG_VER}esr.source.tar.xz -ADDITIONAL=" - patches/disable-jslint.patch - patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch - patches/fix-musl-build.patch - patches/fix-python3.10-compilation.patch - " - -DESC="JavaScript interpreter and libraries - Version 78" - -prepare () { - apply_patches - export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576" - - mountpoint -q /dev/shm || mount -t tmpfs devshm /dev/shm - export PATH=/opt/rustc/bin:$PATH - export LD_LIBRARY_PATH=/opt/rustc/lib:$LD_LIBRARY_PATH - export RUST_TARGET="x86_64" -} - -build () { - mkdir build - cd build - - SHELL=/bin/bash PYTHON=/usr/bin/python3 \ - ../js/src/configure --prefix=/usr \ - --with-intl-api \ - --with-libclang-path=/usr/lib \ - --with-system-icu \ - --with-system-nspr \ - --with-system-zlib \ - --enable-ctypes \ - --enable-hardening \ - --enable-optimize="$CFLAGS -O2" \ - --enable-readline \ - --enable-release \ - --enable-shared-js \ - --enable-system-ffi \ - --enable-tests \ - --disable-debug \ - --disable-debug-symbols \ - --disable-jemalloc \ - --disable-strip - - - make -} - -check () { - dist/bin/jsapi-tests \ - --format=none \ - --exclude-random \ - basic -} - -package () { - make DESTDIR=$PKG_DEST install - [ -f $PKG_DEST/usr/lib/libjs_static.ajs ] && rm $PKG_DEST/usr/lib/libjs_static.ajs - sed -i '/@NSPR_CFLAGS@/d' $PKG_DEST/usr/bin/js78-config -} diff --git a/repo/system/js78/js78.xibuild b/repo/system/js78/js78.xibuild new file mode 100644 index 0000000..199740a --- /dev/null +++ b/repo/system/js78/js78.xibuild @@ -0,0 +1,66 @@ +#!/bin/sh + +MAKEDEPS="gcc autoconf2-13 icu rustc zlib which zip clang llvm patch make python-six python-mach" +DEPS="readline nspr bash zlib" + +PKG_VER=78.15.0 +SOURCE=https://archive.mozilla.org/pub/firefox/releases/${PKG_VER}esr/source/firefox-${PKG_VER}esr.source.tar.xz +ADDITIONAL=" + patches/disable-jslint.patch + patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch + patches/fix-musl-build.patch + patches/fix-python3.10-compilation.patch + " + +DESC="JavaScript interpreter and libraries - Version 78" + +prepare () { + apply_patches + export LDFLAGS="$LDFLAGS -Wl,-z,stack-size=1048576" + + mountpoint -q /dev/shm || mount -t tmpfs devshm /dev/shm + export PATH=/opt/rustc/bin:$PATH + export LD_LIBRARY_PATH=/opt/rustc/lib:$LD_LIBRARY_PATH + export RUST_TARGET="x86_64" +} + +build () { + mkdir build + cd build + + SHELL=/bin/bash PYTHON=/usr/bin/python3 \ + ../js/src/configure --prefix=/usr \ + --with-intl-api \ + --with-libclang-path=/usr/lib \ + --with-system-icu \ + --with-system-nspr \ + --with-system-zlib \ + --enable-ctypes \ + --enable-hardening \ + --enable-optimize="$CFLAGS -O2" \ + --enable-readline \ + --enable-release \ + --enable-shared-js \ + --enable-system-ffi \ + --enable-tests \ + --disable-debug \ + --disable-debug-symbols \ + --disable-jemalloc \ + --disable-strip + + + make +} + +check () { + dist/bin/jsapi-tests \ + --format=none \ + --exclude-random \ + basic +} + +package () { + make DESTDIR=$PKG_DEST install + [ -f $PKG_DEST/usr/lib/libjs_static.ajs ] && rm $PKG_DEST/usr/lib/libjs_static.ajs + sed -i '/@NSPR_CFLAGS@/d' $PKG_DEST/usr/bin/js78-config +} diff --git a/repo/system/js78/patches/disable-jslint.patch b/repo/system/js78/patches/disable-jslint.patch new file mode 100644 index 0000000..04a8b3e --- /dev/null +++ b/repo/system/js78/patches/disable-jslint.patch @@ -0,0 +1,17 @@ +--- a/js/src/build/moz.build ++++ b/js/src/build/moz.build +@@ -80,14 +80,3 @@ + NO_EXPAND_LIBS = True + + DIST_INSTALL = True +- +-# Run SpiderMonkey style checker after linking the static library. This avoids +-# running the script for no-op builds. +-GeneratedFile( +- 'spidermonkey_checks', script='/config/run_spidermonkey_checks.py', +- inputs=[ +- '!%sjs_static.%s' % (CONFIG['LIB_PREFIX'], CONFIG['LIB_SUFFIX']), +- '/config/check_spidermonkey_style.py', +- '/config/check_macroassembler_style.py', +- '/config/check_js_opcode.py' +- ]) diff --git a/repo/system/js78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch b/repo/system/js78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch new file mode 100644 index 0000000..1af68d9 --- /dev/null +++ b/repo/system/js78/patches/fd6847c9416f9eebde636e21d794d25d1be8791d.patch @@ -0,0 +1,37 @@ +See https://bugzilla.mozilla.org/show_bug.cgi?id=1539739 + +From fd6847c9416f9eebde636e21d794d25d1be8791d Mon Sep 17 00:00:00 2001 +From: Mike Hommey +Date: Sat, 1 Jun 2019 09:06:01 +0900 +Subject: [PATCH] Bug 1526653 - Include struct definitions for user_vfp and + user_vfp_exc. + +--- + js/src/wasm/WasmSignalHandlers.cpp | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp +index 636537f8478..383c380f04c 100644 +--- a/js/src/wasm/WasmSignalHandlers.cpp ++++ b/js/src/wasm/WasmSignalHandlers.cpp +@@ -248,7 +248,16 @@ using mozilla::DebugOnly; + #endif + + #ifdef WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS +-# include ++struct user_vfp { ++ unsigned long long fpregs[32]; ++ unsigned long fpscr; ++}; ++ ++struct user_vfp_exc { ++ unsigned long fpexc; ++ unsigned long fpinst; ++ unsigned long fpinst2; ++}; + #endif + + #if defined(ANDROID) +-- +2.20.1 + diff --git a/repo/system/js78/patches/fix-musl-build.patch b/repo/system/js78/patches/fix-musl-build.patch new file mode 100644 index 0000000..af39467 --- /dev/null +++ b/repo/system/js78/patches/fix-musl-build.patch @@ -0,0 +1,16 @@ +Upstream: No +Reason: mozjs60 miscompiles on musl if built with HAVE_THREAD_TLS_KEYWORD: +https://github.com/void-linux/void-packages/issues/2598 +diff --git a/js/src/old-configure.in b/js/src/old-configure.in +--- a/js/src/old-configure.in ++++ b/js/src/old-configure.in +@@ -1272,6 +1272,9 @@ + *-android*|*-linuxandroid*) + : + ;; ++ *-musl*) ++ : ++ ;; + *) + AC_DEFINE(HAVE_THREAD_TLS_KEYWORD) + ;; diff --git a/repo/system/js78/patches/fix-python3.10-compilation.patch b/repo/system/js78/patches/fix-python3.10-compilation.patch new file mode 100644 index 0000000..4473d9b --- /dev/null +++ b/repo/system/js78/patches/fix-python3.10-compilation.patch @@ -0,0 +1,312 @@ +#https://src.fedoraproject.org/rpms/mozjs78/blob/rawhide/f/Fixup-compatibility-of-mozbuild-with-Python-3.10.patch + +m a88d0c8e27b48344942187c2611bb121bde9332d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Franti=C5=A1ek=20Zatloukal?= +Date: Tue, 13 Jul 2021 11:46:20 +0200 +Subject: [PATCH] Fixup compatibility of mozbuild with Python 3.10 + +--- + python/mach/mach/config.py | 4 ++-- + python/mach/mach/main.py | 4 ++-- + python/mach/mach/decorators.py | 2 +- + python/mozbuild/mozbuild/backend/configenvironment.py | 3 ++- + python/mozbuild/mozbuild/makeutil.py | 2 +- + python/mozbuild/mozbuild/util.py | 2 +- + testing/marionette/client/marionette_driver/wait.py | 2 +- + testing/mozbase/manifestparser/manifestparser/filters.py | 3 ++- + testing/mozbase/versioninfo.py | 2 +- + testing/web-platform/tests/tools/manifest/vcs.py | 2 +- + .../web-platform/tests/tools/third_party/h2/h2/settings.py | 2 +- + .../tests/tools/third_party/html5lib/html5lib/_trie/_base.py | 2 +- + .../tools/third_party/html5lib/html5lib/treebuilders/dom.py | 2 +- + .../tests/tools/third_party/hyper/hyper/common/headers.py | 2 +- + .../tests/tools/third_party/hyper/hyper/h2/settings.py | 2 +- + .../tests/tools/third_party/hyper/hyper/http11/connection.py | 4 ++-- + .../third_party/hyper/hyper/packages/hyperframe/flags.py | 2 +- + .../tests/tools/third_party/hyperframe/hyperframe/flags.py | 2 +- + testing/web-platform/tests/tools/wptserve/wptserve/config.py | 3 ++- + testing/web-platform/tests/webdriver/tests/support/sync.py | 2 +- + 19 files changed, 24 insertions(+), 21 deletions(-) + +diff --git a/python/mach/mach/config.py b/python/mach/mach/config.py +index 7210eca82..edb4d2e93 100644 +--- a/python/mach/mach/config.py ++++ b/python/mach/mach/config.py +@@ -144,7 +144,7 @@ def reraise_attribute_error(func): + return _ + + +-class ConfigSettings(collections.Mapping): ++class ConfigSettings(collections.abc.Mapping): + """Interface for configuration settings. + + This is the main interface to the configuration. +@@ -190,7 +190,7 @@ class ConfigSettings(collections.Mapping): + will result in exceptions being raised. + """ + +- class ConfigSection(collections.MutableMapping, object): ++ class ConfigSection(collections.abc.MutableMapping, object): + """Represents an individual config section.""" + def __init__(self, config, name, settings): + object.__setattr__(self, '_config', config) +diff --git a/python/mach/mach/decorators.py b/python/mach/mach/decorators.py +index 27f7f34a6..5f63271a3 100644 +--- a/python/mach/mach/decorators.py ++++ b/python/mach/mach/decorators.py +@@ -140,7 +140,7 @@ def CommandProvider(cls): + 'Conditions argument must take a list ' + \ + 'of functions. Found %s instead.' + +- if not isinstance(command.conditions, collections.Iterable): ++ if not isinstance(command.conditions, collections.abc.Iterable): + msg = msg % (command.name, type(command.conditions)) + raise MachError(msg) + +--- a/python/mach/mach/main.py ++++ b/python/mach/mach/main.py +@@ -16,7 +16,7 @@ + import sys + import traceback + import uuid +-from collections import Iterable ++from collections.abc import Iterable + + from six import string_types + +diff --git a/python/mozbuild/mozbuild/backend/configenvironment.py b/python/mozbuild/mozbuild/backend/configenvironment.py +index 20d1a9fa6..8747958bd 100644 +--- a/python/mozbuild/mozbuild/backend/configenvironment.py ++++ b/python/mozbuild/mozbuild/backend/configenvironment.py +@@ -9,7 +9,8 @@ import six + import sys + import json + +-from collections import Iterable, OrderedDict ++from collections import OrderedDict ++from collections.abc import Iterable + from types import ModuleType + + import mozpack.path as mozpath +diff --git a/python/mozbuild/mozbuild/makeutil.py b/python/mozbuild/mozbuild/makeutil.py +index 4da1a3b26..4ce56848c 100644 +--- a/python/mozbuild/mozbuild/makeutil.py ++++ b/python/mozbuild/mozbuild/makeutil.py +@@ -7,7 +7,7 @@ from __future__ import absolute_import, print_function, unicode_literals + import os + import re + import six +-from collections import Iterable ++from collections.abc import Iterable + + + class Makefile(object): +diff --git a/python/mozbuild/mozbuild/util.py b/python/mozbuild/mozbuild/util.py +index 044cf645c..98ed3ef52 100644 +--- a/python/mozbuild/mozbuild/util.py ++++ b/python/mozbuild/mozbuild/util.py +@@ -782,7 +782,7 @@ class HierarchicalStringList(object): + self._strings = StrictOrderingOnAppendList() + self._children = {} + +- class StringListAdaptor(collections.Sequence): ++ class StringListAdaptor(collections.abc.Sequence): + def __init__(self, hsl): + self._hsl = hsl + +diff --git a/testing/marionette/client/marionette_driver/wait.py b/testing/marionette/client/marionette_driver/wait.py +index eeaa1e23d..c147f463f 100644 +--- a/testing/marionette/client/marionette_driver/wait.py ++++ b/testing/marionette/client/marionette_driver/wait.py +@@ -82,7 +82,7 @@ class Wait(object): + + exceptions = [] + if ignored_exceptions is not None: +- if isinstance(ignored_exceptions, collections.Iterable): ++ if isinstance(ignored_exceptions, collections.abc.Iterable): + exceptions.extend(iter(ignored_exceptions)) + else: + exceptions.append(ignored_exceptions) +diff --git a/testing/mozbase/manifestparser/manifestparser/filters.py b/testing/mozbase/manifestparser/manifestparser/filters.py +index 287ee033b..b1d608003 100644 +--- a/testing/mozbase/manifestparser/manifestparser/filters.py ++++ b/testing/mozbase/manifestparser/manifestparser/filters.py +@@ -12,7 +12,8 @@ from __future__ import absolute_import + + import itertools + import os +-from collections import defaultdict, MutableSequence ++from collections import defaultdict ++from collections.abc import MutableSequence + + import six + from six import string_types +diff --git a/testing/mozbase/versioninfo.py b/testing/mozbase/versioninfo.py +index 91d1a0473..8c1680069 100755 +--- a/testing/mozbase/versioninfo.py ++++ b/testing/mozbase/versioninfo.py +@@ -11,7 +11,7 @@ from commit messages. + + from __future__ import absolute_import, print_function + +-from collections import Iterable ++from collections.abc import Iterable + from distutils.version import StrictVersion + import argparse + import os +diff --git a/testing/web-platform/tests/tools/manifest/vcs.py b/testing/web-platform/tests/tools/manifest/vcs.py +index 7c0feeb81..05ee19c7c 100644 +--- a/testing/web-platform/tests/tools/manifest/vcs.py ++++ b/testing/web-platform/tests/tools/manifest/vcs.py +@@ -3,7 +3,7 @@ import json + import os + import stat + from collections import deque +-from collections import MutableMapping ++from collections.abc import MutableMapping + + from six import with_metaclass, PY2 + +diff --git a/testing/web-platform/tests/tools/third_party/h2/h2/settings.py b/testing/web-platform/tests/tools/third_party/h2/h2/settings.py +index 3da720329..e097630e9 100644 +--- a/testing/web-platform/tests/tools/third_party/h2/h2/settings.py ++++ b/testing/web-platform/tests/tools/third_party/h2/h2/settings.py +@@ -88,7 +88,7 @@ class ChangedSetting: + ) + + +-class Settings(collections.MutableMapping): ++class Settings(collections.abc.MutableMapping): + """ + An object that encapsulates HTTP/2 settings state. + +diff --git a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py +index a1158bbbf..a9295a2ba 100644 +--- a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py ++++ b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/_trie/_base.py +@@ -1,6 +1,6 @@ + from __future__ import absolute_import, division, unicode_literals + +-from collections import Mapping ++from collections.abc import Mapping + + + class Trie(Mapping): +diff --git a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py +index dcfac220b..818a33433 100644 +--- a/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py ++++ b/testing/web-platform/tests/tools/third_party/html5lib/html5lib/treebuilders/dom.py +@@ -1,7 +1,7 @@ + from __future__ import absolute_import, division, unicode_literals + + +-from collections import MutableMapping ++from collections.abc import MutableMapping + from xml.dom import minidom, Node + import weakref + +diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py +index 655a591ac..6454f550a 100644 +--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py ++++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/common/headers.py +@@ -10,7 +10,7 @@ import collections + from hyper.common.util import to_bytestring, to_bytestring_tuple + + +-class HTTPHeaderMap(collections.MutableMapping): ++class HTTPHeaderMap(collections.abc.MutableMapping): + """ + A structure that contains HTTP headers. + +diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py +index fedc5e3c4..040afea92 100755 +--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py ++++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/h2/settings.py +@@ -151,7 +151,7 @@ class ChangedSetting: + ) + + +-class Settings(collections.MutableMapping): ++class Settings(collections.abc.MutableMapping): + """ + An object that encapsulates HTTP/2 settings state. + +diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py +index 61361c358..a214311d2 100644 +--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py ++++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/http11/connection.py +@@ -10,7 +10,7 @@ import os + import socket + import base64 + +-from collections import Iterable, Mapping ++from collections.abc import Iterable, Mapping + + import collections + from hyperframe.frame import SettingsFrame +@@ -295,7 +295,7 @@ class HTTP11Connection(object): + return + + # Iterables that set a specific content length. +- elif isinstance(body, collections.Iterable): ++ elif isinstance(body, collections.abc.Iterable): + for item in body: + try: + self._sock.send(item) +diff --git a/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py b/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py +index e8f630056..8f2ea689b 100644 +--- a/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py ++++ b/testing/web-platform/tests/tools/third_party/hyper/hyper/packages/hyperframe/flags.py +@@ -11,7 +11,7 @@ import collections + Flag = collections.namedtuple("Flag", ["name", "bit"]) + + +-class Flags(collections.MutableSet): ++class Flags(collections.abc.MutableSet): + """ + A simple MutableSet implementation that will only accept known flags as elements. + +diff --git a/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py b/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py +index 05b35017e..14c352e10 100644 +--- a/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py ++++ b/testing/web-platform/tests/tools/third_party/hyperframe/hyperframe/flags.py +@@ -11,7 +11,7 @@ import collections + Flag = collections.namedtuple("Flag", ["name", "bit"]) + + +-class Flags(collections.MutableSet): ++class Flags(collections.abc.MutableSet): + """ + A simple MutableSet implementation that will only accept known flags as + elements. +diff --git a/testing/web-platform/tests/tools/wptserve/wptserve/config.py b/testing/web-platform/tests/tools/wptserve/wptserve/config.py +index 7766565fe..3c1c36d6f 100644 +--- a/testing/web-platform/tests/tools/wptserve/wptserve/config.py ++++ b/testing/web-platform/tests/tools/wptserve/wptserve/config.py +@@ -2,7 +2,8 @@ import copy + import logging + import os + +-from collections import defaultdict, Mapping ++from collections import defaultdict ++from collections.abc import Mapping + from six import integer_types, iteritems, itervalues, string_types + + from . import sslutils +diff --git a/testing/web-platform/tests/webdriver/tests/support/sync.py b/testing/web-platform/tests/webdriver/tests/support/sync.py +index 3fc77131c..8e8f6b819 100644 +--- a/testing/web-platform/tests/webdriver/tests/support/sync.py ++++ b/testing/web-platform/tests/webdriver/tests/support/sync.py +@@ -81,7 +81,7 @@ class Poll(object): + + exceptions = [] + if ignored_exceptions is not None: +- if isinstance(ignored_exceptions, collections.Iterable): ++ if isinstance(ignored_exceptions, collections.abc.Iterable): + exceptions.extend(iter(ignored_exceptions)) + else: + exceptions.append(ignored_exceptions) +-- +2.31.1 + + diff --git a/repo/system/js78/patches/fix-rust-target.patch b/repo/system/js78/patches/fix-rust-target.patch new file mode 100644 index 0000000..f1a98df --- /dev/null +++ b/repo/system/js78/patches/fix-rust-target.patch @@ -0,0 +1,15 @@ +Allow us to just set RUST_TARGEt ourselves instead of hacking around in mozilla's +weird custom build system... + +diff -upr firefox-68.9.0.orig/build/moz.configure/rust.configure firefox-68.9.0/build/moz.configure/rust.configure +--- firefox-68.9.0.orig/build/moz.configure/rust.configure 2020-06-02 22:54:39.982616128 +0200 ++++ firefox-68.9.0/build/moz.configure/rust.configure 2020-06-02 23:08:37.656332899 +0200 +@@ -345,7 +345,7 @@ def rust_triple_alias(host_or_target): + + return None + +- rustc_target = find_candidate(candidates) ++ rustc_target = os.environ['RUST_TARGET'] + + if rustc_target is None: + die("Don't know how to translate {} for rustc".format( diff --git a/repo/system/json-c.xibuild b/repo/system/json-c.xibuild deleted file mode 100644 index 339e62b..0000000 --- a/repo/system/json-c.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -NAME="json-c" -DESC="A JSON implementation in C" - -MAKEDEPS="cmake " -DEPS="musl " - -PKG_VER=0.15 -SOURCE="https://s3.amazonaws.com/json-c_releases/releases/json-c-$PKG_VER.tar.gz" - -build () { - cmake -B build \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=/usr/lib \ - -DBUILD_SHARED_LIBS=True \ - -DBUILD_STATIC_LIBS=OFF - cmake --build build -} - -package () { - DESTDIR="$PKG_DEST" cmake --install build -} diff --git a/repo/system/json-c/json-c.xibuild b/repo/system/json-c/json-c.xibuild new file mode 100644 index 0000000..339e62b --- /dev/null +++ b/repo/system/json-c/json-c.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="json-c" +DESC="A JSON implementation in C" + +MAKEDEPS="cmake " +DEPS="musl " + +PKG_VER=0.15 +SOURCE="https://s3.amazonaws.com/json-c_releases/releases/json-c-$PKG_VER.tar.gz" + +build () { + cmake -B build \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DBUILD_SHARED_LIBS=True \ + -DBUILD_STATIC_LIBS=OFF + cmake --build build +} + +package () { + DESTDIR="$PKG_DEST" cmake --install build +} diff --git a/repo/system/json-glib.xibuild b/repo/system/json-glib.xibuild deleted file mode 100644 index ce9f0b5..0000000 --- a/repo/system/json-glib.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -NAME="json-glib" -DESC="JSON library built on GLib" - -MAKEDEPS="meson ninja " -DEPS="glib musl " - -PKG_VER=1.6.6 -SOURCE="https://download.gnome.org/sources/json-glib/${PKG_VER%.*}/json-glib-$PKG_VER.tar.xz" - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - -Dgtk_doc=disabled \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/json-glib/json-glib.xibuild b/repo/system/json-glib/json-glib.xibuild new file mode 100644 index 0000000..ce9f0b5 --- /dev/null +++ b/repo/system/json-glib/json-glib.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="json-glib" +DESC="JSON library built on GLib" + +MAKEDEPS="meson ninja " +DEPS="glib musl " + +PKG_VER=1.6.6 +SOURCE="https://download.gnome.org/sources/json-glib/${PKG_VER%.*}/json-glib-$PKG_VER.tar.xz" + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + -Dgtk_doc=disabled \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/jsoncpp.xibuild b/repo/system/jsoncpp.xibuild deleted file mode 100644 index 01d3bb6..0000000 --- a/repo/system/jsoncpp.xibuild +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make meson" -DEPS="gcc musl" - -PKG_VER=1.9.5 -SOURCE=https://github.com/open-source-parsers/jsoncpp/archive/$PKG_VER.tar.gz -DESC="JSON C++ library" - -build () { - mkdir build && - cd build && - - meson --prefix=/usr \ - --buildtype=release \ - .. && - ninja - -} - -package () { - DESTDIR=$PKG_DEST ninja install -} - - diff --git a/repo/system/jsoncpp/jsoncpp.xibuild b/repo/system/jsoncpp/jsoncpp.xibuild new file mode 100644 index 0000000..01d3bb6 --- /dev/null +++ b/repo/system/jsoncpp/jsoncpp.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +MAKEDEPS="make meson" +DEPS="gcc musl" + +PKG_VER=1.9.5 +SOURCE=https://github.com/open-source-parsers/jsoncpp/archive/$PKG_VER.tar.gz +DESC="JSON C++ library" + +build () { + mkdir build && + cd build && + + meson --prefix=/usr \ + --buildtype=release \ + .. && + ninja + +} + +package () { + DESTDIR=$PKG_DEST ninja install +} + + diff --git a/repo/system/kbd.xibuild b/repo/system/kbd.xibuild deleted file mode 100644 index 9c48903..0000000 --- a/repo/system/kbd.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl pam" - -PKG_VER=2.4.0 -SOURCE=https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-$PKG_VER.tar.xz -DESC="Keytable files and keyboard utilities" - -prepare () { - # remove redundant resizecons program - sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure - sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in -} - -build () { - ./configure --prefix=/usr --disable-vlock - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/kbd/kbd.xibuild b/repo/system/kbd/kbd.xibuild new file mode 100644 index 0000000..9c48903 --- /dev/null +++ b/repo/system/kbd/kbd.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl pam" + +PKG_VER=2.4.0 +SOURCE=https://mirrors.edge.kernel.org/pub/linux/utils/kbd/kbd-$PKG_VER.tar.xz +DESC="Keytable files and keyboard utilities" + +prepare () { + # remove redundant resizecons program + sed -i '/RESIZECONS_PROGS=/s/yes/no/' configure + sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in +} + +build () { + ./configure --prefix=/usr --disable-vlock + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/kmod.xibuild b/repo/system/kmod.xibuild deleted file mode 100644 index 673036a..0000000 --- a/repo/system/kmod.xibuild +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl zlib openssl xz zstd" - -PKG_VER=29 -SOURCE=https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-$PKG_VER.tar.xz -DESC="Libraries and utilities for managing kernel modules" - -build () { - ./autogen.sh - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --with-xz \ - --with-zstd \ - --with-zlib - - make -} - -package () { - make DESTDIR=$PKG_DEST install - mkdir -p /usr/bin - ln -s kmod $PKG_DEST/usr/bin/depmod - ln -s kmod $PKG_DEST/usr/bin/insmod - ln -s kmod $PKG_DEST/usr/bin/modinfo - ln -s kmod $PKG_DEST/usr/bin/modprobe - ln -s kmod $PKG_DEST/usr/bin/rmmod - ln -s kmod $PKG_DEST/usr/bin/lsmod -} diff --git a/repo/system/kmod/kmod.xibuild b/repo/system/kmod/kmod.xibuild new file mode 100644 index 0000000..673036a --- /dev/null +++ b/repo/system/kmod/kmod.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl zlib openssl xz zstd" + +PKG_VER=29 +SOURCE=https://www.kernel.org/pub/linux/utils/kernel/kmod/kmod-$PKG_VER.tar.xz +DESC="Libraries and utilities for managing kernel modules" + +build () { + ./autogen.sh + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-xz \ + --with-zstd \ + --with-zlib + + make +} + +package () { + make DESTDIR=$PKG_DEST install + mkdir -p /usr/bin + ln -s kmod $PKG_DEST/usr/bin/depmod + ln -s kmod $PKG_DEST/usr/bin/insmod + ln -s kmod $PKG_DEST/usr/bin/modinfo + ln -s kmod $PKG_DEST/usr/bin/modprobe + ln -s kmod $PKG_DEST/usr/bin/rmmod + ln -s kmod $PKG_DEST/usr/bin/lsmod +} diff --git a/repo/system/krb5.xibuild b/repo/system/krb5.xibuild deleted file mode 100644 index 4ed4ef7..0000000 --- a/repo/system/krb5.xibuild +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl e2fsprogs libldap keyutils gdbm" - -PKG_VER=1.19.2 -SOURCE=http://kerberos.org/dist/krb5/${PKG_VER%.*}/krb5-${PKG_VER}.tar.gz - -ADDITIONAL=" - https://www.linuxfromscratch.org/patches/blfs/svn/mitkrb-${PKG_VER}-openssl3_fixes-1.patch -" - -DESC="The Kerberos network authentication system" - -prepare () { - - # fix denial of service vulnerability - sed -i '210a if (sprinc == NULL) {\ - status = "NULL_SERVER";\ - errcode = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;\ - goto cleanup;\ - }' src/kdc/do_tgs_req.c - - - cd src && - #these were needed for libressl - #patch -Np0 -i ../patch-plugins_preauth_pkinit_pkinit__crypto__openssl.c - #patch -Np0 -i ../patch-plugins_preauth_pkinit_pkinit__crypto__openssl.h - patch -Np2 -i ../mitkrb-$PKG_VER-openssl3_fixes-1.patch - - - sed -e "/LDFLAGS=/d" -i build-tools/krb5-config.in - sed -i -e 's@\^u}@^u cols 300}@' tests/dejagnu/config/default.exp || true - sed -i -e '/eq 0/{N;s/12 //}' plugins/kdb/db2/libdb2/test/run.test || true - sed -i '/t_iprop.py/d' tests/Makefile.in || true -} - -build () { - # would be ideal to use openssl rather than builtin library - autoreconf - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var/lib \ - --runstatedir=/run \ - --with-system-et \ - --with-system-ss \ - --with-system-verto=no \ - --with-crypto-impl=builtin \ - --enable-dns-for-realm && - - make -} - -package () { - make DESTDIR=$PKG_DEST install - - install -dm755 $PKG_DEST/usr/share/doc/krb5-$PKG_VER && - cp -fr ../doc/* $PKG_DEST/usr/share/doc/krb5-$PKG_VER -} diff --git a/repo/system/krb5/krb5.xibuild b/repo/system/krb5/krb5.xibuild new file mode 100644 index 0000000..4ed4ef7 --- /dev/null +++ b/repo/system/krb5/krb5.xibuild @@ -0,0 +1,59 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl e2fsprogs libldap keyutils gdbm" + +PKG_VER=1.19.2 +SOURCE=http://kerberos.org/dist/krb5/${PKG_VER%.*}/krb5-${PKG_VER}.tar.gz + +ADDITIONAL=" + https://www.linuxfromscratch.org/patches/blfs/svn/mitkrb-${PKG_VER}-openssl3_fixes-1.patch +" + +DESC="The Kerberos network authentication system" + +prepare () { + + # fix denial of service vulnerability + sed -i '210a if (sprinc == NULL) {\ + status = "NULL_SERVER";\ + errcode = KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN;\ + goto cleanup;\ + }' src/kdc/do_tgs_req.c + + + cd src && + #these were needed for libressl + #patch -Np0 -i ../patch-plugins_preauth_pkinit_pkinit__crypto__openssl.c + #patch -Np0 -i ../patch-plugins_preauth_pkinit_pkinit__crypto__openssl.h + patch -Np2 -i ../mitkrb-$PKG_VER-openssl3_fixes-1.patch + + + sed -e "/LDFLAGS=/d" -i build-tools/krb5-config.in + sed -i -e 's@\^u}@^u cols 300}@' tests/dejagnu/config/default.exp || true + sed -i -e '/eq 0/{N;s/12 //}' plugins/kdb/db2/libdb2/test/run.test || true + sed -i '/t_iprop.py/d' tests/Makefile.in || true +} + +build () { + # would be ideal to use openssl rather than builtin library + autoreconf + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var/lib \ + --runstatedir=/run \ + --with-system-et \ + --with-system-ss \ + --with-system-verto=no \ + --with-crypto-impl=builtin \ + --enable-dns-for-realm && + + make +} + +package () { + make DESTDIR=$PKG_DEST install + + install -dm755 $PKG_DEST/usr/share/doc/krb5-$PKG_VER && + cp -fr ../doc/* $PKG_DEST/usr/share/doc/krb5-$PKG_VER +} diff --git a/repo/system/lcms2.xibuild b/repo/system/lcms2.xibuild deleted file mode 100644 index 3f9cdd3..0000000 --- a/repo/system/lcms2.xibuild +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -NAME="lcms2" -DESC="Color Management Engine" - -MAKEDEPS="make libjpeg-turbo tiff zlib" -DEPS="musl " - -PKG_VER=2.13.1 -SOURCE="https://github.com/mm2/Little-CMS/releases/download/lcms$PKG_VER/lcms2-$PKG_VER.tar.gz" - -build () { - ./configure \ - --prefix=/usr - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static \ - --with-jpeg \ - --with-tiff \ - --with-zlib \ - --with-threads - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/lcms2/lcms2.xibuild b/repo/system/lcms2/lcms2.xibuild new file mode 100644 index 0000000..3f9cdd3 --- /dev/null +++ b/repo/system/lcms2/lcms2.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="lcms2" +DESC="Color Management Engine" + +MAKEDEPS="make libjpeg-turbo tiff zlib" +DEPS="musl " + +PKG_VER=2.13.1 +SOURCE="https://github.com/mm2/Little-CMS/releases/download/lcms$PKG_VER/lcms2-$PKG_VER.tar.gz" + +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static \ + --with-jpeg \ + --with-tiff \ + --with-zlib \ + --with-threads + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/ldns.xibuild b/repo/system/ldns.xibuild deleted file mode 100644 index a835ee6..0000000 --- a/repo/system/ldns.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make libpcap" -DEPS="openssl libpcap" - -PKG_VER=1.8.1 -SOURCE=https://www.nlnetlabs.nl/downloads/ldns/ldns-$PKG_VER.tar.gz -DESC="Free software implementation of IDNA2008, Punycode and TR46" - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-rpath \ - --with-drill \ - --disable-dane-verify \ - --with-examples \ - --with-trust-anchor=/etc/trusted-key.key \ - - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/ldns/ldns.xibuild b/repo/system/ldns/ldns.xibuild new file mode 100644 index 0000000..a835ee6 --- /dev/null +++ b/repo/system/ldns/ldns.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="make libpcap" +DEPS="openssl libpcap" + +PKG_VER=1.8.1 +SOURCE=https://www.nlnetlabs.nl/downloads/ldns/ldns-$PKG_VER.tar.gz +DESC="Free software implementation of IDNA2008, Punycode and TR46" + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-rpath \ + --with-drill \ + --disable-dane-verify \ + --with-examples \ + --with-trust-anchor=/etc/trusted-key.key \ + + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libarchive.xibuild b/repo/system/libarchive.xibuild deleted file mode 100644 index c03c225..0000000 --- a/repo/system/libarchive.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make autoconf libtool" -DEPS="acl bzip2 expat lz4 openssl xz zlib zstd" - -PKG_VER=3.5.2 -SOURCE=https://github.com/libarchive/libarchive/releases/download/v$PKG_VER/libarchive-$PKG_VER.tar.xz - -DESC="A library that provides a single interface for reading and writing various compression formats" - -prepare () { - sed -i '436a if ((OSSL_PROVIDER_load(NULL, "legacy")) == NULL) \ - return (ARCHIVE_FAILED);' libarchive/archive_digest.c -} - -build () { - ./configure --prefix=/usr --disable-static --without-xml2 --without-nettle - make -} - -package() { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libarchive/libarchive.xibuild b/repo/system/libarchive/libarchive.xibuild new file mode 100644 index 0000000..c03c225 --- /dev/null +++ b/repo/system/libarchive/libarchive.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make autoconf libtool" +DEPS="acl bzip2 expat lz4 openssl xz zlib zstd" + +PKG_VER=3.5.2 +SOURCE=https://github.com/libarchive/libarchive/releases/download/v$PKG_VER/libarchive-$PKG_VER.tar.xz + +DESC="A library that provides a single interface for reading and writing various compression formats" + +prepare () { + sed -i '436a if ((OSSL_PROVIDER_load(NULL, "legacy")) == NULL) \ + return (ARCHIVE_FAILED);' libarchive/archive_digest.c +} + +build () { + ./configure --prefix=/usr --disable-static --without-xml2 --without-nettle + make +} + +package() { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libcap-ng.xibuild b/repo/system/libcap-ng.xibuild deleted file mode 100644 index a67ebbf..0000000 --- a/repo/system/libcap-ng.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=0.8.2 -SOURCE=https://github.com/stevegrubb/libcap-ng/archive/refs/tags/v$PKG_VER.tar.gz - -DESC="A library for linux that makes posix capabilities easy" - -build () { - ./autogen.sh - ./configure --prefix=/usr - make prefix=/usr lib=lib -} - -package() { - make prefix=/usr lib=lib DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libcap-ng/libcap-ng.xibuild b/repo/system/libcap-ng/libcap-ng.xibuild new file mode 100644 index 0000000..a67ebbf --- /dev/null +++ b/repo/system/libcap-ng/libcap-ng.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=0.8.2 +SOURCE=https://github.com/stevegrubb/libcap-ng/archive/refs/tags/v$PKG_VER.tar.gz + +DESC="A library for linux that makes posix capabilities easy" + +build () { + ./autogen.sh + ./configure --prefix=/usr + make prefix=/usr lib=lib +} + +package() { + make prefix=/usr lib=lib DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libcap.xibuild b/repo/system/libcap.xibuild deleted file mode 100644 index dab917e..0000000 --- a/repo/system/libcap.xibuild +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl pam" - -PKG_VER=2.62 -SOURCE=https://git.kernel.org/pub/scm/libs/libcap/libcap.git/snapshot/libcap-$PKG_VER.tar.gz - -DESC="POSIX 1003.1e capabilities" - -prepare () { - sed -i '/install -m.*STA/d' libcap/Makefile - sed -i 's/xargs -e/xargs /g' pam_cap/Makefile -} - -build () { - make prefix=/usr lib=lib -} - -check () { - make test -} - -package() { - make prefix=/usr lib=lib DESTDIR=$PKG_DEST install - chmod 755 $PKG_DEST/usr/lib/libcap.so.* - chmod 755 $PKG_DEST/usr/lib/libpsx.so.* - -} diff --git a/repo/system/libcap/libcap.xibuild b/repo/system/libcap/libcap.xibuild new file mode 100644 index 0000000..dab917e --- /dev/null +++ b/repo/system/libcap/libcap.xibuild @@ -0,0 +1,29 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl pam" + +PKG_VER=2.62 +SOURCE=https://git.kernel.org/pub/scm/libs/libcap/libcap.git/snapshot/libcap-$PKG_VER.tar.gz + +DESC="POSIX 1003.1e capabilities" + +prepare () { + sed -i '/install -m.*STA/d' libcap/Makefile + sed -i 's/xargs -e/xargs /g' pam_cap/Makefile +} + +build () { + make prefix=/usr lib=lib +} + +check () { + make test +} + +package() { + make prefix=/usr lib=lib DESTDIR=$PKG_DEST install + chmod 755 $PKG_DEST/usr/lib/libcap.so.* + chmod 755 $PKG_DEST/usr/lib/libpsx.so.* + +} diff --git a/repo/system/libconfig.xibuild b/repo/system/libconfig.xibuild deleted file mode 100644 index b81a2bd..0000000 --- a/repo/system/libconfig.xibuild +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -NAME="libconfig" -DESC="A simple library for manipulating structured configuration files" - -MAKEDEPS="make automake autoconf libtool" -DEPS="musl" - -PKG_VER=1.7.3 -SOURCE="https://github.com/hyperrealm/libconfig/archive/v$PKG_VER.tar.gz" - -prepare () { - autoreconf -fi -} - -build () { - ./configure \ - --prefix=/usr - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make -j1 DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libconfig/libconfig.xibuild b/repo/system/libconfig/libconfig.xibuild new file mode 100644 index 0000000..b81a2bd --- /dev/null +++ b/repo/system/libconfig/libconfig.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +NAME="libconfig" +DESC="A simple library for manipulating structured configuration files" + +MAKEDEPS="make automake autoconf libtool" +DEPS="musl" + +PKG_VER=1.7.3 +SOURCE="https://github.com/hyperrealm/libconfig/archive/v$PKG_VER.tar.gz" + +prepare () { + autoreconf -fi +} + +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make -j1 DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libdwarf.xibuild b/repo/system/libdwarf.xibuild deleted file mode 100644 index 66aec4f..0000000 --- a/repo/system/libdwarf.xibuild +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -MAKEDEPS="elfutils zlib" -DEPS="musl zlib libelf" - -PKG_VER=20210528 -SOURCE=http://www.prevanders.net/libdwarf-$PKG_VER.tar.gz -DESC="Parsing library for DWARF2 and later debugging file format" - -build () { - ./configure \ - --prefix=/usr \ - --enable-shared \ - --enable-dwarfgen - make -} - -check () { - make check -} - - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libdwarf/libdwarf.xibuild b/repo/system/libdwarf/libdwarf.xibuild new file mode 100644 index 0000000..66aec4f --- /dev/null +++ b/repo/system/libdwarf/libdwarf.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +MAKEDEPS="elfutils zlib" +DEPS="musl zlib libelf" + +PKG_VER=20210528 +SOURCE=http://www.prevanders.net/libdwarf-$PKG_VER.tar.gz +DESC="Parsing library for DWARF2 and later debugging file format" + +build () { + ./configure \ + --prefix=/usr \ + --enable-shared \ + --enable-dwarfgen + make +} + +check () { + make check +} + + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libedit.xibuild b/repo/system/libedit.xibuild deleted file mode 100644 index b594d83..0000000 --- a/repo/system/libedit.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make automake autoconf" -DEPS="musl ncurses" - -PKG_VER=20210910-3.1 -SOURCE=https://www.thrysoee.dk/editline/libedit-20210910-3.1.tar.gz -DESC="BSD line editing library" - -prepare () { - autoreconf -fi -} - -build () { - ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - - diff --git a/repo/system/libedit/libedit.xibuild b/repo/system/libedit/libedit.xibuild new file mode 100644 index 0000000..b594d83 --- /dev/null +++ b/repo/system/libedit/libedit.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make automake autoconf" +DEPS="musl ncurses" + +PKG_VER=20210910-3.1 +SOURCE=https://www.thrysoee.dk/editline/libedit-20210910-3.1.tar.gz +DESC="BSD line editing library" + +prepare () { + autoreconf -fi +} + +build () { + ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + + diff --git a/repo/system/libelf.xibuild b/repo/system/libelf.xibuild deleted file mode 100644 index 5ec93b0..0000000 --- a/repo/system/libelf.xibuild +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl-fts musl-obstack argp-standalone" - -SOURCE=https://sourceware.org/elfutils/ftp/elfutils-latest.tar.bz2 -DESC="Handle ELF object files and DWARF debugging information" - -ADDITIONAL=" - https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/files/elfutils-void/error.h -" - -prepare() { - cp error.h lib/ - cp error.h src/ - - autoreconf -if - -} - -build () { - CFLAGS="-DFNM_EXTMATCH=0 -Wno-error -Wno-error=null-dereference -Wl,-z,stack-size=2097152" \ - ./configure --prefix=/usr --disable-debuginfod \ - --enable-libdebuginfod=dummy - make -C lib && make -C libelf -} - -package () { - make -C libelf DESTDIR=$PKG_DEST install - - install -d -m644 config/libelf.pc $PKG_DEST/usr/lib/pkgconfig -} diff --git a/repo/system/libelf/libelf.xibuild b/repo/system/libelf/libelf.xibuild new file mode 100644 index 0000000..5ec93b0 --- /dev/null +++ b/repo/system/libelf/libelf.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl-fts musl-obstack argp-standalone" + +SOURCE=https://sourceware.org/elfutils/ftp/elfutils-latest.tar.bz2 +DESC="Handle ELF object files and DWARF debugging information" + +ADDITIONAL=" + https://raw.githubusercontent.com/dslm4515/Musl-LFS/master/files/elfutils-void/error.h +" + +prepare() { + cp error.h lib/ + cp error.h src/ + + autoreconf -if + +} + +build () { + CFLAGS="-DFNM_EXTMATCH=0 -Wno-error -Wno-error=null-dereference -Wl,-z,stack-size=2097152" \ + ./configure --prefix=/usr --disable-debuginfod \ + --enable-libdebuginfod=dummy + make -C lib && make -C libelf +} + +package () { + make -C libelf DESTDIR=$PKG_DEST install + + install -d -m644 config/libelf.pc $PKG_DEST/usr/lib/pkgconfig +} diff --git a/repo/system/libev.xibuild b/repo/system/libev.xibuild deleted file mode 100644 index 6f43e9b..0000000 --- a/repo/system/libev.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl" - -PKG_VER=4.33 -SOURCE=http://dist.schmorp.de/libev/Attic/libev-$PKG_VER.tar.gz -ADDITIONAL=" - libev-4.11-Add-pkgconfig-support.patch -" - -DESC="Library for applications dealing with netlink sockets" - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static && - make -} - -package () { - make -j1 DESTDIR=$PKG_DEST install - rm $PKG_DEST/usr/include/event.h -} diff --git a/repo/system/libev/libev-4.11-Add-pkgconfig-support.patch b/repo/system/libev/libev-4.11-Add-pkgconfig-support.patch new file mode 100644 index 0000000..8c478ca --- /dev/null +++ b/repo/system/libev/libev-4.11-Add-pkgconfig-support.patch @@ -0,0 +1,58 @@ +From 01d2c386b58afa49567ccc079c963f76dc2e60f3 Mon Sep 17 00:00:00 2001 +From: Mathieu Bridon +Date: Fri, 8 Feb 2013 15:40:51 +0800 +Subject: [PATCH] Add pkgconfig support + +--- + Makefile.am | 4 ++++ + configure.ac | 2 +- + libev.pc.in | 11 +++++++++++ + 3 files changed, 16 insertions(+), 1 deletion(-) + create mode 100644 libev.pc.in + +diff --git a/Makefile.am b/Makefile.am +index 059305b..9e556c0 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -11,6 +11,10 @@ man_MANS = ev.3 + + include_HEADERS = ev.h ev++.h event.h + ++pkgconfigdir = $(libdir)/pkgconfig ++ ++pkgconfig_DATA = libev.pc ++ + lib_LTLIBRARIES = libev.la + + libev_la_SOURCES = ev.c event.c +diff --git a/configure.ac b/configure.ac +index 31d0a25..1af149a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -21,5 +21,5 @@ AC_PROG_LIBTOOL + + m4_include([libev.m4]) + +-AC_CONFIG_FILES([Makefile]) ++AC_CONFIG_FILES([Makefile libev.pc]) + AC_OUTPUT +diff --git a/libev.pc.in b/libev.pc.in +new file mode 100644 +index 0000000..3b6c636 +--- /dev/null ++++ b/libev.pc.in +@@ -0,0 +1,11 @@ ++prefix=@prefix@ ++exec_prefix=@prefix@ ++libdir=@libdir@ ++includedir=@includedir@ ++ ++Name: libev ++Description: High-performance event loop/event model ++Version: @VERSION@ ++Libs: -L${libdir} -lev ++Libs.private: ++Cflags: -I${includedir} +-- +1.8.1 + diff --git a/repo/system/libev/libev.xibuild b/repo/system/libev/libev.xibuild new file mode 100644 index 0000000..6f43e9b --- /dev/null +++ b/repo/system/libev/libev.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=4.33 +SOURCE=http://dist.schmorp.de/libev/Attic/libev-$PKG_VER.tar.gz +ADDITIONAL=" + libev-4.11-Add-pkgconfig-support.patch +" + +DESC="Library for applications dealing with netlink sockets" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static && + make +} + +package () { + make -j1 DESTDIR=$PKG_DEST install + rm $PKG_DEST/usr/include/event.h +} diff --git a/repo/system/libevent.xibuild b/repo/system/libevent.xibuild deleted file mode 100644 index 84e2dd4..0000000 --- a/repo/system/libevent.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -NAME="libevent" -DESC="An event notification library" - -MAKEDEPS="make " -DEPS="openssl musl " - -PKG_VER=2.1.12 -SOURCE="https://github.com/libevent/libevent/releases/download/release-$PKG_VER-stable/libevent-$PKG_VER-stable.tar.gz" - -prepare() { - sed -i '1s|^#!/usr/bin/env python$|#!/usr/bin/python3|' event_rpcgen.py - sed -i -e "s/@VERSION@/$PKG_VER/" *.pc.in -} - -build () { - ./configure \ - --prefix=/usr - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make -j1 DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libevent/libevent.xibuild b/repo/system/libevent/libevent.xibuild new file mode 100644 index 0000000..84e2dd4 --- /dev/null +++ b/repo/system/libevent/libevent.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="libevent" +DESC="An event notification library" + +MAKEDEPS="make " +DEPS="openssl musl " + +PKG_VER=2.1.12 +SOURCE="https://github.com/libevent/libevent/releases/download/release-$PKG_VER-stable/libevent-$PKG_VER-stable.tar.gz" + +prepare() { + sed -i '1s|^#!/usr/bin/env python$|#!/usr/bin/python3|' event_rpcgen.py + sed -i -e "s/@VERSION@/$PKG_VER/" *.pc.in +} + +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make -j1 DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libexif.xibuild b/repo/system/libexif.xibuild deleted file mode 100644 index 129c73a..0000000 --- a/repo/system/libexif.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -NAME="libexif" -DESC="library to parse an EXIF file and read the data from those tags" - -MAKEDEPS="make " -DEPS="musl " - -PKG_VER=0.6.24 -SOURCE="https://github.com/libexif/libexif/releases/download/v$PKG_VER/libexif-$PKG_VER.tar.bz2" - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libexif/libexif.xibuild b/repo/system/libexif/libexif.xibuild new file mode 100644 index 0000000..129c73a --- /dev/null +++ b/repo/system/libexif/libexif.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="libexif" +DESC="library to parse an EXIF file and read the data from those tags" + +MAKEDEPS="make " +DEPS="musl " + +PKG_VER=0.6.24 +SOURCE="https://github.com/libexif/libexif/releases/download/v$PKG_VER/libexif-$PKG_VER.tar.bz2" + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libffi.xibuild b/repo/system/libffi.xibuild deleted file mode 100644 index d802142..0000000 --- a/repo/system/libffi.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=3.4.2 -SOURCE=https://github.com/libffi/libffi/releases/download/v$PKG_VER/libffi-$PKG_VER.tar.gz -DESC="Portable foreign function interface library" - -build () { - ./configure --prefix=/usr --disable-static --with-gcc-arch=native --disable-exec-static-tramp - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libffi/libffi.xibuild b/repo/system/libffi/libffi.xibuild new file mode 100644 index 0000000..d802142 --- /dev/null +++ b/repo/system/libffi/libffi.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=3.4.2 +SOURCE=https://github.com/libffi/libffi/releases/download/v$PKG_VER/libffi-$PKG_VER.tar.gz +DESC="Portable foreign function interface library" + +build () { + ./configure --prefix=/usr --disable-static --with-gcc-arch=native --disable-exec-static-tramp + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libfm-extra.xibuild b/repo/system/libfm-extra.xibuild deleted file mode 100644 index 7cb00fa..0000000 --- a/repo/system/libfm-extra.xibuild +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -NAME="libfm-extra" -DESC="Library for file management (Extra)" - -MAKEDEPS="make libtool intltool autoconf automake gtk3" -DEPS="libexif" - -PKG_VER=1.3.2 -SOURCE="https://github.com/lxde/libfm/archive/$PKG_VER.tar.gz" - -prepare () { - ./autogen.sh -} - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static \ - --with-gtk=3 \ - --with-extra-only \ - --with-gnu-ld - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libfm-extra/libfm-extra.xibuild b/repo/system/libfm-extra/libfm-extra.xibuild new file mode 100644 index 0000000..7cb00fa --- /dev/null +++ b/repo/system/libfm-extra/libfm-extra.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="libfm-extra" +DESC="Library for file management (Extra)" + +MAKEDEPS="make libtool intltool autoconf automake gtk3" +DEPS="libexif" + +PKG_VER=1.3.2 +SOURCE="https://github.com/lxde/libfm/archive/$PKG_VER.tar.gz" + +prepare () { + ./autogen.sh +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static \ + --with-gtk=3 \ + --with-extra-only \ + --with-gnu-ld + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libfm.xibuild b/repo/system/libfm.xibuild deleted file mode 100644 index 21661e5..0000000 --- a/repo/system/libfm.xibuild +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -NAME="libfm" -DESC="Library for file management" - -MAKEDEPS="make libtool intltool autoconf automake gtk3" -DEPS="libexif menu-cache" - -PKG_VER=1.3.2 -SOURCE="https://github.com/lxde/libfm/archive/$PKG_VER.tar.gz" - -prepare () { - ./autogen.sh -} - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static \ - --with-gtk=3 \ - --with-extra \ - --with-gnu-ld - sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libfm/libfm.xibuild b/repo/system/libfm/libfm.xibuild new file mode 100644 index 0000000..21661e5 --- /dev/null +++ b/repo/system/libfm/libfm.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="libfm" +DESC="Library for file management" + +MAKEDEPS="make libtool intltool autoconf automake gtk3" +DEPS="libexif menu-cache" + +PKG_VER=1.3.2 +SOURCE="https://github.com/lxde/libfm/archive/$PKG_VER.tar.gz" + +prepare () { + ./autogen.sh +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static \ + --with-gtk=3 \ + --with-extra \ + --with-gnu-ld + sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libgcrypt.xibuild b/repo/system/libgcrypt.xibuild deleted file mode 100644 index 4c90552..0000000 --- a/repo/system/libgcrypt.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl libgpg-error" - -PKG_VER=1.9.4 -SOURCE=https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$PKG_VER.tar.bz2 -DESC="General purpose crypto library based on the code used in GnuPG" - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --enable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - - diff --git a/repo/system/libgcrypt/libgcrypt.xibuild b/repo/system/libgcrypt/libgcrypt.xibuild new file mode 100644 index 0000000..4c90552 --- /dev/null +++ b/repo/system/libgcrypt/libgcrypt.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl libgpg-error" + +PKG_VER=1.9.4 +SOURCE=https://www.gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-$PKG_VER.tar.bz2 +DESC="General purpose crypto library based on the code used in GnuPG" + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --enable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + + diff --git a/repo/system/libgpg-error.xibuild b/repo/system/libgpg-error.xibuild deleted file mode 100644 index 7498665..0000000 --- a/repo/system/libgpg-error.xibuild +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl" - -PKG_VER=1.42 -SOURCE=https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$PKG_VER.tar.bz2 -DESC="Support library for libgcrypt" - -prepare() { - default_prepare - aclocal - automake -} - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --enable-static \ - --disable-nls - make - -} - -package () { - make DESTDIR=$PKG_DEST install -} - - diff --git a/repo/system/libgpg-error/libgpg-error.xibuild b/repo/system/libgpg-error/libgpg-error.xibuild new file mode 100644 index 0000000..7498665 --- /dev/null +++ b/repo/system/libgpg-error/libgpg-error.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=1.42 +SOURCE=https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$PKG_VER.tar.bz2 +DESC="Support library for libgcrypt" + +prepare() { + default_prepare + aclocal + automake +} + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --enable-static \ + --disable-nls + make + +} + +package () { + make DESTDIR=$PKG_DEST install +} + + diff --git a/repo/system/libgudev.xibuild b/repo/system/libgudev.xibuild deleted file mode 100644 index a365c76..0000000 --- a/repo/system/libgudev.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="meson" -DEPS="glib2 libudev" - -PKG_VER=237 -SOURCE=https://download.gnome.org/sources/libgudev/$PKG_VER/libgudev-$PKG_VER.tar.xz -DESC="GObject bindings for libudev" - -build () { - mkdir build && - cd build && - - meson --prefix=/usr --buildtype=release .. && - ninja - -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/libgudev/libgudev.xibuild b/repo/system/libgudev/libgudev.xibuild new file mode 100644 index 0000000..a365c76 --- /dev/null +++ b/repo/system/libgudev/libgudev.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="meson" +DEPS="glib2 libudev" + +PKG_VER=237 +SOURCE=https://download.gnome.org/sources/libgudev/$PKG_VER/libgudev-$PKG_VER.tar.xz +DESC="GObject bindings for libudev" + +build () { + mkdir build && + cd build && + + meson --prefix=/usr --buildtype=release .. && + ninja + +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/libidn.xibuild b/repo/system/libidn.xibuild deleted file mode 100644 index f592955..0000000 --- a/repo/system/libidn.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make findutils" -DEPS="musl libunistring" - -PKG_VER=2.3.2 -SOURCE=https://ftp.gnu.org/gnu/libidn/libidn2-$PKG_VER.tar.gz -DESC="Free software implementation of IDNA2008, Punycode and TR46" - -build () { - ./configure --prefix=/usr --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install - - find ./doc -name "Makefile*" -delete && - rm -rf doc/gdoc && - rm -rf doc/idn.1 && - rm -rf doc/stamp-vti && - rm -rf doc/man && - rm -rf doc/texi && - mkdir -p $PKG_DEST/usr/share/doc/libidn-$PKG_VER && - cp -r doc/* $PKG_DEST/usr/share/doc/libidn-$PKG_VER -} diff --git a/repo/system/libidn/libidn.xibuild b/repo/system/libidn/libidn.xibuild new file mode 100644 index 0000000..f592955 --- /dev/null +++ b/repo/system/libidn/libidn.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="make findutils" +DEPS="musl libunistring" + +PKG_VER=2.3.2 +SOURCE=https://ftp.gnu.org/gnu/libidn/libidn2-$PKG_VER.tar.gz +DESC="Free software implementation of IDNA2008, Punycode and TR46" + +build () { + ./configure --prefix=/usr --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install + + find ./doc -name "Makefile*" -delete && + rm -rf doc/gdoc && + rm -rf doc/idn.1 && + rm -rf doc/stamp-vti && + rm -rf doc/man && + rm -rf doc/texi && + mkdir -p $PKG_DEST/usr/share/doc/libidn-$PKG_VER && + cp -r doc/* $PKG_DEST/usr/share/doc/libidn-$PKG_VER +} diff --git a/repo/system/libldap.xibuild b/repo/system/libldap.xibuild deleted file mode 100644 index 5faf692..0000000 --- a/repo/system/libldap.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make groff" -DEPS="libidn libsasl" - -PKG_VER=2.6.0 -SOURCE=http://repository.linagora.org/OpenLDAP/openldap-release/openldap-$PKG_VER.tgz -DESC="An open source implementation of the Lightweight Directory Access Protocol" - -build () { - ./configure prefix="/usr" - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libldap/libldap.xibuild b/repo/system/libldap/libldap.xibuild new file mode 100644 index 0000000..5faf692 --- /dev/null +++ b/repo/system/libldap/libldap.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make groff" +DEPS="libidn libsasl" + +PKG_VER=2.6.0 +SOURCE=http://repository.linagora.org/OpenLDAP/openldap-release/openldap-$PKG_VER.tgz +DESC="An open source implementation of the Lightweight Directory Access Protocol" + +build () { + ./configure prefix="/usr" + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/liblinear.xibuild b/repo/system/liblinear.xibuild deleted file mode 100644 index 7a20846..0000000 --- a/repo/system/liblinear.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=243 -SOURCE=https://github.com/cjlin1/liblinear/archive/v$PKG_VER/liblinear-$PKG_VER.tar.gz -DESC="A library for large linear classification" - -build () { - make lib -} - -package () { - mkdir -p ${PKG_DEST}/usr/include - mkdir -p ${PKG_DEST}/usr/lib - install -m644 linear.h $PKG_DEST/usr/include && - install -m755 liblinear.so.4 $PKG_DEST/usr/lib && - ln -sf liblinear.so.4 $PKG_DEST/usr/lib/liblinear.so -} diff --git a/repo/system/liblinear/liblinear.xibuild b/repo/system/liblinear/liblinear.xibuild new file mode 100644 index 0000000..7a20846 --- /dev/null +++ b/repo/system/liblinear/liblinear.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=243 +SOURCE=https://github.com/cjlin1/liblinear/archive/v$PKG_VER/liblinear-$PKG_VER.tar.gz +DESC="A library for large linear classification" + +build () { + make lib +} + +package () { + mkdir -p ${PKG_DEST}/usr/include + mkdir -p ${PKG_DEST}/usr/lib + install -m644 linear.h $PKG_DEST/usr/include && + install -m755 liblinear.so.4 $PKG_DEST/usr/lib && + ln -sf liblinear.so.4 $PKG_DEST/usr/lib/liblinear.so +} diff --git a/repo/system/libluv.xibuild b/repo/system/libluv.xibuild deleted file mode 100644 index fabd348..0000000 --- a/repo/system/libluv.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make luajit" -DEPS="musl libuv" - -PKG_VER=1.42.0-0 -SOURCE=https://github.com/luvit/luv/releases/download/$PKG_VER/luv-$PKG_VER.tar.gz -DESC="Bare libuv bindings for lua" - -build() { - cmake -B build -G Ninja \ - -DCMAKE_BUILD_TYPE=None \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DWITH_SHARED_LIBUV=ON \ - -DLUA_BUILD_TYPE=System \ - -DBUILD_MODULE=OFF \ - -DBUILD_SHARED_LIBS=ON \ - -DBUILD_STATIC_LIBS=OFF - cmake --build build -} - -package() { - DESTDIR="$PKG_DEST" cmake --install build -} diff --git a/repo/system/libluv/libluv.xibuild b/repo/system/libluv/libluv.xibuild new file mode 100644 index 0000000..fabd348 --- /dev/null +++ b/repo/system/libluv/libluv.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make luajit" +DEPS="musl libuv" + +PKG_VER=1.42.0-0 +SOURCE=https://github.com/luvit/luv/releases/download/$PKG_VER/luv-$PKG_VER.tar.gz +DESC="Bare libuv bindings for lua" + +build() { + cmake -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=None \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DWITH_SHARED_LIBUV=ON \ + -DLUA_BUILD_TYPE=System \ + -DBUILD_MODULE=OFF \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF + cmake --build build +} + +package() { + DESTDIR="$PKG_DEST" cmake --install build +} diff --git a/repo/system/libmbim.xibuild b/repo/system/libmbim.xibuild deleted file mode 100644 index 8fe1d88..0000000 --- a/repo/system/libmbim.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.26.2 -SOURCE=https://www.freedesktop.org/software/libmbim/libmbim-$PKG_VER.tar.xz -DESC="MBIM modem protocol helper library" - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-static \ - --enable-introspection=yes - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libmbim/libmbim.xibuild b/repo/system/libmbim/libmbim.xibuild new file mode 100644 index 0000000..8fe1d88 --- /dev/null +++ b/repo/system/libmbim/libmbim.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.26.2 +SOURCE=https://www.freedesktop.org/software/libmbim/libmbim-$PKG_VER.tar.xz +DESC="MBIM modem protocol helper library" + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static \ + --enable-introspection=yes + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libmpack.xibuild b/repo/system/libmpack.xibuild deleted file mode 100644 index 3685876..0000000 --- a/repo/system/libmpack.xibuild +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.0.5 -SOURCE=https://github.com/libmpack/libmpack/archive/$PKG_VER.tar.gz -DESC="Simple implementation of msgpack in C" - -build () { - make -} - -package () { - make DESTDIR=$PKG_DEST PREFIX=/usr install -} diff --git a/repo/system/libmpack/libmpack.xibuild b/repo/system/libmpack/libmpack.xibuild new file mode 100644 index 0000000..3685876 --- /dev/null +++ b/repo/system/libmpack/libmpack.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.0.5 +SOURCE=https://github.com/libmpack/libmpack/archive/$PKG_VER.tar.gz +DESC="Simple implementation of msgpack in C" + +build () { + make +} + +package () { + make DESTDIR=$PKG_DEST PREFIX=/usr install +} diff --git a/repo/system/libndp.xibuild b/repo/system/libndp.xibuild deleted file mode 100644 index 8e061ef..0000000 --- a/repo/system/libndp.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make flex" -DEPS="musl" - -PKG_VER=1.8 -SOURCE=http://libndp.org/files/libndp-$PKG_VER.tar.gz -DESC="A wrapper for IPv6 Neighbor Discovery Protocol" - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libndp/libndp.xibuild b/repo/system/libndp/libndp.xibuild new file mode 100644 index 0000000..8e061ef --- /dev/null +++ b/repo/system/libndp/libndp.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make flex" +DEPS="musl" + +PKG_VER=1.8 +SOURCE=http://libndp.org/files/libndp-$PKG_VER.tar.gz +DESC="A wrapper for IPv6 Neighbor Discovery Protocol" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libnghttp.xibuild b/repo/system/libnghttp.xibuild deleted file mode 100644 index 6f006dc..0000000 --- a/repo/system/libnghttp.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.46.0 - -SOURCE=https://github.com/nghttp2/nghttp2/releases/download/v$PKG_VER/nghttp2-$PKG_VER.tar.xz -DESC="Framing layer of HTTP implemented as a C library" - - -build () { - ./configure --prefix=/usr \ - --disable-static \ - --enable-lib-only \ - --docdir=/usr/share/doc/nghttp2-$PKG_VER && - make -} -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libnghttp/libnghttp.xibuild b/repo/system/libnghttp/libnghttp.xibuild new file mode 100644 index 0000000..6f006dc --- /dev/null +++ b/repo/system/libnghttp/libnghttp.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.46.0 + +SOURCE=https://github.com/nghttp2/nghttp2/releases/download/v$PKG_VER/nghttp2-$PKG_VER.tar.xz +DESC="Framing layer of HTTP implemented as a C library" + + +build () { + ./configure --prefix=/usr \ + --disable-static \ + --enable-lib-only \ + --docdir=/usr/share/doc/nghttp2-$PKG_VER && + make +} +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libnl.xibuild b/repo/system/libnl.xibuild deleted file mode 100644 index 7ea18ba..0000000 --- a/repo/system/libnl.xibuild +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make tar gzip" -DEPS="musl" - -PKG_VER=3.5.0 -SOURCE=https://github.com/thom311/libnl/releases/download/libnl$(echo $PKG_VER | sed 's/\./_/g')/libnl-$PKG_VER.tar.gz -ADDITIONAL=" - https://github.com/thom311/libnl/releases/download/libnl$(echo $PKG_VER | sed 's/\./_/g')/libnl-doc-$PKG_VER.tar.gz -" - -DESC="Library for applications dealing with netlink sockets" - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install - - mkdir -p $PKG_DEST/usr/share/doc/libnl-$PKG_VER && - /usr/bin/tar -xf libnl-doc-$PKG_VER.tar.gz --strip-components=1 --no-same-owner \ - -C $PKG_DEST/usr/share/doc/libnl-$PKG_VER -} diff --git a/repo/system/libnl/libnl.xibuild b/repo/system/libnl/libnl.xibuild new file mode 100644 index 0000000..7ea18ba --- /dev/null +++ b/repo/system/libnl/libnl.xibuild @@ -0,0 +1,27 @@ +#!/bin/sh + +MAKEDEPS="make tar gzip" +DEPS="musl" + +PKG_VER=3.5.0 +SOURCE=https://github.com/thom311/libnl/releases/download/libnl$(echo $PKG_VER | sed 's/\./_/g')/libnl-$PKG_VER.tar.gz +ADDITIONAL=" + https://github.com/thom311/libnl/releases/download/libnl$(echo $PKG_VER | sed 's/\./_/g')/libnl-doc-$PKG_VER.tar.gz +" + +DESC="Library for applications dealing with netlink sockets" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install + + mkdir -p $PKG_DEST/usr/share/doc/libnl-$PKG_VER && + /usr/bin/tar -xf libnl-doc-$PKG_VER.tar.gz --strip-components=1 --no-same-owner \ + -C $PKG_DEST/usr/share/doc/libnl-$PKG_VER +} diff --git a/repo/system/libnsl.xibuild b/repo/system/libnsl.xibuild deleted file mode 100644 index 051272b..0000000 --- a/repo/system/libnsl.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make autoconf automake gettext libtirpc libtool" -DEPS="libintl libtirpc musl" - -PKG_VER=1.2.0 -SOURCE=https://github.com/thkukuk/libnsl/archive/v$PKG_VER.tar.gz - -DESC="Public client interface for NIS(YP) and NIS+ in a IPv6 ready version" - -prepare () { - autoreconf -vfi -} - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libnsl/libnsl.xibuild b/repo/system/libnsl/libnsl.xibuild new file mode 100644 index 0000000..051272b --- /dev/null +++ b/repo/system/libnsl/libnsl.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make autoconf automake gettext libtirpc libtool" +DEPS="libintl libtirpc musl" + +PKG_VER=1.2.0 +SOURCE=https://github.com/thkukuk/libnsl/archive/v$PKG_VER.tar.gz + +DESC="Public client interface for NIS(YP) and NIS+ in a IPv6 ready version" + +prepare () { + autoreconf -vfi +} + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libp11-kit.xibuild b/repo/system/libp11-kit.xibuild deleted file mode 100644 index 11d33be..0000000 --- a/repo/system/libp11-kit.xibuild +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl libtasn1 libffi" - -PKG_VER=0.24.1 -SOURCE=https://github.com/p11-glue/p11-kit/releases/download/$PKG_VER/p11-kit-$PKG_VER.tar.xz -DESC="Loads and enumerates PKCS#11 modules" - -prepare () { - sed '20,$ d' -i trust/trust-extract-compat && - cat >> trust/trust-extract-compat << "EOF" -# Copy existing anchor modifications to /etc/ssl/local -/usr/libexec/make-ca/copy-trust-modifications - -# Generate a new trust store -/usr/sbin/make-ca -f -g -EOF -} - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --with-trust-paths=/etc/pki/anchors - make -} - -package () { - make DESTDIR=$PKG_DEST install - ln -sf $PKG_DEST/usr/libexec/p11-kit/trust-extract-compat \ - $PKG_DEST/usr/bin/update-ca-certificates -} - diff --git a/repo/system/libp11-kit/libp11-kit.xibuild b/repo/system/libp11-kit/libp11-kit.xibuild new file mode 100644 index 0000000..11d33be --- /dev/null +++ b/repo/system/libp11-kit/libp11-kit.xibuild @@ -0,0 +1,33 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl libtasn1 libffi" + +PKG_VER=0.24.1 +SOURCE=https://github.com/p11-glue/p11-kit/releases/download/$PKG_VER/p11-kit-$PKG_VER.tar.xz +DESC="Loads and enumerates PKCS#11 modules" + +prepare () { + sed '20,$ d' -i trust/trust-extract-compat && + cat >> trust/trust-extract-compat << "EOF" +# Copy existing anchor modifications to /etc/ssl/local +/usr/libexec/make-ca/copy-trust-modifications + +# Generate a new trust store +/usr/sbin/make-ca -f -g +EOF +} + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --with-trust-paths=/etc/pki/anchors + make +} + +package () { + make DESTDIR=$PKG_DEST install + ln -sf $PKG_DEST/usr/libexec/p11-kit/trust-extract-compat \ + $PKG_DEST/usr/bin/update-ca-certificates +} + diff --git a/repo/system/libpcap.xibuild b/repo/system/libpcap.xibuild deleted file mode 100644 index 27e56c5..0000000 --- a/repo/system/libpcap.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="libnl libusb" - -PKG_VER=1.10.1 -SOURCE=https://www.tcpdump.org/release/libpcap-$PKG_VER.tar.gz -DESC="A library providing user level packet capture" - -build () { - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libpcap/libpcap.xibuild b/repo/system/libpcap/libpcap.xibuild new file mode 100644 index 0000000..27e56c5 --- /dev/null +++ b/repo/system/libpcap/libpcap.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="libnl libusb" + +PKG_VER=1.10.1 +SOURCE=https://www.tcpdump.org/release/libpcap-$PKG_VER.tar.gz +DESC="A library providing user level packet capture" + +build () { + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libpipeline.xibuild b/repo/system/libpipeline.xibuild deleted file mode 100644 index e7cac33..0000000 --- a/repo/system/libpipeline.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.5.5 -SOURCE=http://download.savannah.nongnu.org/releases/libpipeline/libpipeline-$PKG_VER.tar.gz -DESC="A library for manipulating pipelines of subprocesses in a flexible and convenient way" - -build () { - ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libpipeline/libpipeline.xibuild b/repo/system/libpipeline/libpipeline.xibuild new file mode 100644 index 0000000..e7cac33 --- /dev/null +++ b/repo/system/libpipeline/libpipeline.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.5.5 +SOURCE=http://download.savannah.nongnu.org/releases/libpipeline/libpipeline-$PKG_VER.tar.gz +DESC="A library for manipulating pipelines of subprocesses in a flexible and convenient way" + +build () { + ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libpng.xibuild b/repo/system/libpng.xibuild deleted file mode 100644 index e40077d..0000000 --- a/repo/system/libpng.xibuild +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="" - -PKG_VER=1.6.37 -SOURCE=https://downloads.sourceforge.net/libpng/libpng-$PKG_VER.tar.xz -DESC="A collection of routines used to create PNG images" -ADDITIONAL="libpng-1.6.37-apng.patch" - -prepare () { - apply_patches -} - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install - mkdir -p $PKG_DEST/usr/share/doc/libpng-$PKG_VER && - cp README libpng-manual.txt $PKG_DEST/usr/share/doc/libpng-$PKG_VER - -} diff --git a/repo/system/libpng/libpng-1.6.37-apng.patch b/repo/system/libpng/libpng-1.6.37-apng.patch new file mode 100644 index 0000000..8aaa50b --- /dev/null +++ b/repo/system/libpng/libpng-1.6.37-apng.patch @@ -0,0 +1,1728 @@ +diff -Naru libpng-1.6.37.org/png.h libpng-1.6.37/png.h +--- libpng-1.6.37.org/png.h 2019-04-19 07:21:37.398024800 +0900 ++++ libpng-1.6.37/png.h 2019-04-19 07:22:37.871245630 +0900 +@@ -330,6 +330,10 @@ + # include "pnglibconf.h" + #endif + ++#define PNG_APNG_SUPPORTED ++#define PNG_READ_APNG_SUPPORTED ++#define PNG_WRITE_APNG_SUPPORTED ++ + #ifndef PNG_VERSION_INFO_ONLY + /* Machine specific configuration. */ + # include "pngconf.h" +@@ -425,6 +429,17 @@ + * See pngconf.h for base types that vary by machine/system + */ + ++#ifdef PNG_APNG_SUPPORTED ++/* dispose_op flags from inside fcTL */ ++#define PNG_DISPOSE_OP_NONE 0x00U ++#define PNG_DISPOSE_OP_BACKGROUND 0x01U ++#define PNG_DISPOSE_OP_PREVIOUS 0x02U ++ ++/* blend_op flags from inside fcTL */ ++#define PNG_BLEND_OP_SOURCE 0x00U ++#define PNG_BLEND_OP_OVER 0x01U ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* This triggers a compiler error in png.c, if png.c and png.h + * do not agree upon the version number. + */ +@@ -746,6 +761,10 @@ + #define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ + #define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ + #define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_INFO_acTL 0x20000U ++#define PNG_INFO_fcTL 0x40000U ++#endif + + /* This is used for the transformation routines, as some of them + * change these values for the row. It also should enable using +@@ -783,6 +802,10 @@ + #ifdef PNG_PROGRESSIVE_READ_SUPPORTED + typedef PNG_CALLBACK(void, *png_progressive_info_ptr, (png_structp, png_infop)); + typedef PNG_CALLBACK(void, *png_progressive_end_ptr, (png_structp, png_infop)); ++#ifdef PNG_APNG_SUPPORTED ++typedef PNG_CALLBACK(void, *png_progressive_frame_ptr, (png_structp, ++ png_uint_32)); ++#endif + + /* The following callback receives png_uint_32 row_number, int pass for the + * png_bytep data of the row. When transforming an interlaced image the +@@ -3226,6 +3249,74 @@ + /******************************************************************************* + * END OF HARDWARE AND SOFTWARE OPTIONS + ******************************************************************************/ ++#ifdef PNG_APNG_SUPPORTED ++PNG_EXPORT(250, png_uint_32, png_get_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); ++ ++PNG_EXPORT(251, png_uint_32, png_set_acTL, (png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); ++ ++PNG_EXPORT(252, png_uint_32, png_get_num_frames, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(253, png_uint_32, png_get_num_plays, (png_structp png_ptr, ++ png_infop info_ptr)); ++ ++PNG_EXPORT(254, png_uint_32, png_get_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, ++ png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, ++ png_byte *blend_op)); ++ ++PNG_EXPORT(255, png_uint_32, png_set_next_frame_fcTL, ++ (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, ++ png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(256, png_uint_32, png_get_next_frame_width, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(257, png_uint_32, png_get_next_frame_height, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(258, png_uint_32, png_get_next_frame_x_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(259, png_uint_32, png_get_next_frame_y_offset, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(260, png_uint_16, png_get_next_frame_delay_num, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(261, png_uint_16, png_get_next_frame_delay_den, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(262, png_byte, png_get_next_frame_dispose_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(263, png_byte, png_get_next_frame_blend_op, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(264, png_byte, png_get_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr)); ++PNG_EXPORT(265, png_uint_32, png_set_first_frame_is_hidden, ++ (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_EXPORT(266, void, png_read_frame_head, (png_structp png_ptr, ++ png_infop info_ptr)); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_EXPORT(267, void, png_set_progressive_frame_fn, (png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn)); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_EXPORT(268, void, png_write_frame_head, (png_structp png_ptr, ++ png_infop info_ptr, png_bytepp row_pointers, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op)); ++ ++PNG_EXPORT(269, void, png_write_frame_tail, (png_structp png_ptr, ++ png_infop info_ptr)); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ + + /* Maintainer: Put new public prototypes here ^, in libpng.3, in project + * defs, and in scripts/symbols.def. +@@ -3235,7 +3326,11 @@ + * one to use is one more than this.) + */ + #ifdef PNG_EXPORT_LAST_ORDINAL ++#ifdef PNG_APNG_SUPPORTED ++ PNG_EXPORT_LAST_ORDINAL(269); ++#else + PNG_EXPORT_LAST_ORDINAL(249); ++#endif /* PNG_APNG_SUPPORTED */ + #endif + + #ifdef __cplusplus +diff -Naru libpng-1.6.37.org/pngget.c libpng-1.6.37/pngget.c +--- libpng-1.6.37.org/pngget.c 2019-04-19 07:21:37.399024787 +0900 ++++ libpng-1.6.37/pngget.c 2019-04-19 07:22:37.850245901 +0900 +@@ -1246,4 +1246,166 @@ + # endif + #endif + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_get_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *num_frames, png_uint_32 *num_plays) ++{ ++ png_debug1(1, "in %s retrieval function", "acTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_acTL) && ++ num_frames != NULL && num_plays != NULL) ++ { ++ *num_frames = info_ptr->num_frames; ++ *num_plays = info_ptr->num_plays; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_frames(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_frames()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_frames); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_num_plays(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_num_plays()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->num_plays); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 *width, png_uint_32 *height, ++ png_uint_32 *x_offset, png_uint_32 *y_offset, ++ png_uint_16 *delay_num, png_uint_16 *delay_den, ++ png_byte *dispose_op, png_byte *blend_op) ++{ ++ png_debug1(1, "in %s retrieval function", "fcTL"); ++ ++ if (png_ptr != NULL && info_ptr != NULL && ++ (info_ptr->valid & PNG_INFO_fcTL) && ++ width != NULL && height != NULL && ++ x_offset != NULL && y_offset != NULL && ++ delay_num != NULL && delay_den != NULL && ++ dispose_op != NULL && blend_op != NULL) ++ { ++ *width = info_ptr->next_frame_width; ++ *height = info_ptr->next_frame_height; ++ *x_offset = info_ptr->next_frame_x_offset; ++ *y_offset = info_ptr->next_frame_y_offset; ++ *delay_num = info_ptr->next_frame_delay_num; ++ *delay_den = info_ptr->next_frame_delay_den; ++ *dispose_op = info_ptr->next_frame_dispose_op; ++ *blend_op = info_ptr->next_frame_blend_op; ++ return (1); ++ } ++ ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_width(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_width()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_width); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_height(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_height()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_height); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_x_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_x_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_x_offset); ++ return (0); ++} ++ ++png_uint_32 PNGAPI ++png_get_next_frame_y_offset(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_y_offset()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_y_offset); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_num(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_num()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_num); ++ return (0); ++} ++ ++png_uint_16 PNGAPI ++png_get_next_frame_delay_den(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_delay_den()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_delay_den); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_dispose_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_dispose_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_dispose_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_next_frame_blend_op(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_get_next_frame_blend_op()"); ++ ++ if (png_ptr != NULL && info_ptr != NULL) ++ return (info_ptr->next_frame_blend_op); ++ return (0); ++} ++ ++png_byte PNGAPI ++png_get_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr != NULL) ++ return (png_byte)(png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN); ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 0; ++} ++#endif /* PNG_APNG_SUPPORTED */ + #endif /* READ || WRITE */ +diff -Naru libpng-1.6.37.org/pnginfo.h libpng-1.6.37/pnginfo.h +--- libpng-1.6.37.org/pnginfo.h 2019-04-19 07:21:37.399024787 +0900 ++++ libpng-1.6.37/pnginfo.h 2019-04-19 07:22:37.850245901 +0900 +@@ -263,5 +263,18 @@ + png_bytepp row_pointers; /* the image bits */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; /* including default image */ ++ png_uint_32 num_plays; ++ png_uint_32 next_frame_width; ++ png_uint_32 next_frame_height; ++ png_uint_32 next_frame_x_offset; ++ png_uint_32 next_frame_y_offset; ++ png_uint_16 next_frame_delay_num; ++ png_uint_16 next_frame_delay_den; ++ png_byte next_frame_dispose_op; ++ png_byte next_frame_blend_op; ++#endif ++ + }; + #endif /* PNGINFO_H */ +diff -Naru libpng-1.6.37.org/pngpread.c libpng-1.6.37/pngpread.c +--- libpng-1.6.37.org/pngpread.c 2019-04-19 07:21:37.399024787 +0900 ++++ libpng-1.6.37/pngpread.c 2019-04-19 07:22:37.850245901 +0900 +@@ -195,6 +195,106 @@ + + chunk_name = png_ptr->chunk_name; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0 && ++ png_ptr->num_frames_read < info_ptr->num_frames) ++ { ++ if (chunk_name == png_IDAT) ++ { ++ /* Discard trailing IDATs for the first frame */ ++ if (png_ptr->mode & PNG_HAVE_fcTL || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "out of place IDAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ else if (chunk_name == png_fdAT) ++ { ++ if (png_ptr->buffer_size < 4) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ensure_sequence_number(png_ptr, 4); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ { ++ /* Discard trailing fdATs for frames other than the first */ ++ if (png_ptr->num_frames_read < 2) ++ png_error(png_ptr, "out of place fdAT"); ++ ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ else ++ { ++ /* frame data follows */ ++ png_ptr->idat_size = png_ptr->push_length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ png_ptr->process_mode = PNG_READ_IDAT_MODE; ++ ++ return; ++ } ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_read_reset(png_ptr); ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_fcTL)) ++ png_error(png_ptr, "missing required fcTL chunk"); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ png_progressive_read_reset(png_ptr); ++ ++ if (png_ptr->frame_info_fn != NULL) ++ (*(png_ptr->frame_info_fn))(png_ptr, png_ptr->num_frames_read); ++ ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ ++ return; ++ } ++ ++ else ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ ++ return; ++ } ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + if (chunk_name == png_IDAT) + { + if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) +@@ -261,6 +361,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = png_ptr->push_length; + png_ptr->process_mode = PNG_READ_IDAT_MODE; + png_push_have_info(png_ptr, info_ptr); +@@ -406,6 +509,30 @@ + png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); + } + #endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_acTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++ else if (chunk_name == png_fcTL) ++ { ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ ++ png_handle_fcTL(png_ptr, info_ptr, png_ptr->push_length); ++ } ++ ++#endif /* PNG_READ_APNG_SUPPORTED */ + + else + { +@@ -539,7 +666,11 @@ + png_byte chunk_tag[4]; + + /* TODO: this code can be commoned up with the same code in push_read */ ++#ifdef PNG_READ_APNG_SUPPORTED ++ PNG_PUSH_SAVE_BUFFER_IF_LT(12) ++#else + PNG_PUSH_SAVE_BUFFER_IF_LT(8) ++#endif + png_push_fill_buffer(png_ptr, chunk_length, 4); + png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); + png_reset_crc(png_ptr); +@@ -547,17 +678,64 @@ + png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); + png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_fdAT && png_ptr->num_frames_read > 0) ++ { ++ if (png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) ++ { ++ png_ptr->process_mode = PNG_READ_CHUNK_MODE; ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++ return; ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->push_length + 4 > png_ptr->buffer_size) ++ { ++ png_push_save_buffer(png_ptr); ++ return; ++ } ++ png_warning(png_ptr, "Skipping (ignoring) a chunk between " ++ "APNG chunks"); ++ png_crc_finish(png_ptr, png_ptr->push_length); ++ png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; ++ return; ++ } ++ } ++ else ++#endif ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->chunk_name != png_IDAT && png_ptr->num_frames_read == 0) ++#else + if (png_ptr->chunk_name != png_IDAT) ++#endif + { + png_ptr->process_mode = PNG_READ_CHUNK_MODE; + + if ((png_ptr->flags & PNG_FLAG_ZSTREAM_ENDED) == 0) + png_error(png_ptr, "Not enough compressed data"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->frame_end_fn != NULL) ++ (*(png_ptr->frame_end_fn))(png_ptr, png_ptr->num_frames_read); ++ png_ptr->num_frames_read++; ++#endif ++ + return; + } + + png_ptr->idat_size = png_ptr->push_length; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ if (png_ptr->num_frames_read > 0) ++ { ++ png_ensure_sequence_number(png_ptr, 4); ++ png_ptr->idat_size -= 4; ++ } ++#endif + } + + if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) +@@ -631,6 +809,15 @@ + if (!(buffer_length > 0) || buffer == NULL) + png_error(png_ptr, "No IDAT data (internal error)"); + ++#ifdef PNG_READ_APNG_SUPPORTED ++ /* If the app is not APNG-aware, decode only the first frame */ ++ if (!(png_ptr->apng_flags & PNG_APNG_APP) && png_ptr->num_frames_read > 0) ++ { ++ png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++ return; ++ } ++#endif ++ + /* This routine must process all the data it has been given + * before returning, calling the row callback as required to + * handle the uncompressed results. +@@ -1085,6 +1272,18 @@ + png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); + } + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_set_progressive_frame_fn(png_structp png_ptr, ++ png_progressive_frame_ptr frame_info_fn, ++ png_progressive_frame_ptr frame_end_fn) ++{ ++ png_ptr->frame_info_fn = frame_info_fn; ++ png_ptr->frame_end_fn = frame_end_fn; ++ png_ptr->apng_flags |= PNG_APNG_APP; ++} ++#endif ++ + png_voidp PNGAPI + png_get_progressive_ptr(png_const_structrp png_ptr) + { +diff -Naru libpng-1.6.37.org/pngpriv.h libpng-1.6.37/pngpriv.h +--- libpng-1.6.37.org/pngpriv.h 2019-04-19 07:21:37.399024787 +0900 ++++ libpng-1.6.37/pngpriv.h 2019-04-19 07:22:37.850245901 +0900 +@@ -637,6 +637,10 @@ + #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */ + /* 0x4000U (unused) */ + #define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */ ++#ifdef PNG_APNG_SUPPORTED ++#define PNG_HAVE_acTL 0x10000U ++#define PNG_HAVE_fcTL 0x20000U ++#endif + + /* Flags for the transformations the PNG library does on the image data */ + #define PNG_BGR 0x0001U +@@ -873,6 +877,16 @@ + #define png_tRNS PNG_U32(116, 82, 78, 83) + #define png_zTXt PNG_U32(122, 84, 88, 116) + ++#ifdef PNG_APNG_SUPPORTED ++#define png_acTL PNG_U32( 97, 99, 84, 76) ++#define png_fcTL PNG_U32(102, 99, 84, 76) ++#define png_fdAT PNG_U32(102, 100, 65, 84) ++ ++/* For png_struct.apng_flags: */ ++#define PNG_FIRST_FRAME_HIDDEN 0x0001U ++#define PNG_APNG_APP 0x0002U ++#endif ++ + /* The following will work on (signed char*) strings, whereas the get_uint_32 + * macro will fail on top-bit-set values because of the sign extension. + */ +@@ -1644,6 +1658,47 @@ + */ + #endif + ++#ifdef PNG_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_ensure_fcTL_is_valid,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op), PNG_EMPTY); ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_handle_acTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fcTL,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_handle_fdAT,(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_have_info,(png_structp png_ptr, png_infop info_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_ensure_sequence_number,(png_structp png_ptr, ++ png_uint_32 length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_read_reinit,(png_structp png_ptr, ++ png_infop info_ptr),PNG_EMPTY); ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_progressive_read_reset,(png_structp png_ptr),PNG_EMPTY); ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++PNG_INTERNAL_FUNCTION(void,png_write_acTL,(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fcTL,(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_fdAT,(png_structp png_ptr, ++ png_const_bytep data, png_size_t length),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reset,(png_structp png_ptr),PNG_EMPTY); ++PNG_INTERNAL_FUNCTION(void,png_write_reinit,(png_structp png_ptr, ++ png_infop info_ptr, png_uint_32 width, png_uint_32 height),PNG_EMPTY); ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* Added at libpng version 1.4.0 */ + #ifdef PNG_COLORSPACE_SUPPORTED + /* These internal functions are for maintaining the colorspace structure within +diff -Naru libpng-1.6.37.org/pngread.c libpng-1.6.37/pngread.c +--- libpng-1.6.37.org/pngread.c 2019-04-19 07:21:37.400024774 +0900 ++++ libpng-1.6.37/pngread.c 2019-04-19 07:22:37.851245887 +0900 +@@ -161,6 +161,9 @@ + + else if (chunk_name == png_IDAT) + { ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_have_info(png_ptr, info_ptr); ++#endif + png_ptr->idat_size = length; + break; + } +@@ -255,6 +258,17 @@ + png_handle_iTXt(png_ptr, info_ptr, length); + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++ else if (chunk_name == png_acTL) ++ png_handle_acTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fcTL) ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ ++ else if (chunk_name == png_fdAT) ++ png_handle_fdAT(png_ptr, info_ptr, length); ++#endif ++ + else + png_handle_unknown(png_ptr, info_ptr, length, + PNG_HANDLE_CHUNK_AS_DEFAULT); +@@ -262,6 +276,72 @@ + } + #endif /* SEQUENTIAL_READ */ + ++#ifdef PNG_READ_APNG_SUPPORTED ++void PNGAPI ++png_read_frame_head(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_byte have_chunk_after_DAT; /* after IDAT or after fdAT */ ++ ++ png_debug(0, "Reading frame head"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_acTL)) ++ png_error(png_ptr, "attempt to png_read_frame_head() but " ++ "no acTL present"); ++ ++ /* do nothing for the main IDAT */ ++ if (png_ptr->num_frames_read == 0) ++ return; ++ ++ png_read_reset(png_ptr); ++ png_ptr->flags &= ~PNG_FLAG_ROW_INIT; ++ png_ptr->mode &= ~PNG_HAVE_fcTL; ++ ++ have_chunk_after_DAT = 0; ++ for (;;) ++ { ++ png_uint_32 length = png_read_chunk_header(png_ptr); ++ ++ if (png_ptr->chunk_name == png_IDAT) ++ { ++ /* discard trailing IDATs for the first frame */ ++ if (have_chunk_after_DAT || png_ptr->num_frames_read > 1) ++ png_error(png_ptr, "png_read_frame_head(): out of place IDAT"); ++ png_crc_finish(png_ptr, length); ++ } ++ ++ else if (png_ptr->chunk_name == png_fcTL) ++ { ++ png_handle_fcTL(png_ptr, info_ptr, length); ++ have_chunk_after_DAT = 1; ++ } ++ ++ else if (png_ptr->chunk_name == png_fdAT) ++ { ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* discard trailing fdATs for frames other than the first */ ++ if (!have_chunk_after_DAT && png_ptr->num_frames_read > 1) ++ png_crc_finish(png_ptr, length - 4); ++ else if(png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_ptr->idat_size = length - 4; ++ png_ptr->mode |= PNG_HAVE_IDAT; ++ ++ break; ++ } ++ else ++ png_error(png_ptr, "png_read_frame_head(): out of place fdAT"); ++ } ++ else ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ png_crc_finish(png_ptr, length); ++ } ++ } ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + /* Optional call to update the users info_ptr structure */ + void PNGAPI + png_read_update_info(png_structrp png_ptr, png_inforp info_ptr) +diff -Naru libpng-1.6.37.org/pngrutil.c libpng-1.6.37/pngrutil.c +--- libpng-1.6.37.org/pngrutil.c 2019-04-19 07:21:37.401024761 +0900 ++++ libpng-1.6.37/pngrutil.c 2019-04-19 07:22:37.853245862 +0900 +@@ -865,6 +865,11 @@ + filter_type = buf[11]; + interlace_type = buf[12]; + ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + /* Set internal variables */ + png_ptr->width = width; + png_ptr->height = height; +@@ -2857,6 +2862,179 @@ + } + #endif + ++#ifdef PNG_READ_APNG_SUPPORTED ++void /* PRIVATE */ ++png_handle_acTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[8]; ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++ png_uint_32 didSet; ++ ++ png_debug(1, "in png_handle_acTL"); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before acTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ png_warning(png_ptr, "Invalid acTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_acTL) ++ { ++ png_warning(png_ptr, "Duplicate acTL skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ else if (length != 8) ++ { ++ png_warning(png_ptr, "acTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 8); ++ png_crc_finish(png_ptr, 0); ++ ++ num_frames = png_get_uint_31(png_ptr, data); ++ num_plays = png_get_uint_31(png_ptr, data + 4); ++ ++ /* the set function will do error checking on num_frames */ ++ didSet = png_set_acTL(png_ptr, info_ptr, num_frames, num_plays); ++ if(didSet) ++ png_ptr->mode |= PNG_HAVE_acTL; ++} ++ ++void /* PRIVATE */ ++png_handle_fcTL(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_byte data[22]; ++ png_uint_32 width; ++ png_uint_32 height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ ++ png_debug(1, "in png_handle_fcTL"); ++ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ if (!(png_ptr->mode & PNG_HAVE_IHDR)) ++ { ++ png_error(png_ptr, "Missing IHDR before fcTL"); ++ } ++ else if (png_ptr->mode & PNG_HAVE_IDAT) ++ { ++ /* for any frames other then the first this message may be misleading, ++ * but correct. PNG_HAVE_IDAT is unset before the frame head is read ++ * i can't think of a better message */ ++ png_warning(png_ptr, "Invalid fcTL after IDAT skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (png_ptr->mode & PNG_HAVE_fcTL) ++ { ++ png_warning(png_ptr, "Duplicate fcTL within one frame skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ else if (length != 26) ++ { ++ png_warning(png_ptr, "fcTL with invalid length skipped"); ++ png_crc_finish(png_ptr, length-4); ++ return; ++ } ++ ++ png_crc_read(png_ptr, data, 22); ++ png_crc_finish(png_ptr, 0); ++ ++ width = png_get_uint_31(png_ptr, data); ++ height = png_get_uint_31(png_ptr, data + 4); ++ x_offset = png_get_uint_31(png_ptr, data + 8); ++ y_offset = png_get_uint_31(png_ptr, data + 12); ++ delay_num = png_get_uint_16(data + 16); ++ delay_den = png_get_uint_16(data + 18); ++ dispose_op = data[20]; ++ blend_op = data[21]; ++ ++ if (png_ptr->num_frames_read == 0 && (x_offset != 0 || y_offset != 0)) ++ { ++ png_warning(png_ptr, "fcTL for the first frame must have zero offset"); ++ return; ++ } ++ ++ if (info_ptr != NULL) ++ { ++ if (png_ptr->num_frames_read == 0 && ++ (width != info_ptr->width || height != info_ptr->height)) ++ { ++ png_warning(png_ptr, "size in first frame's fcTL must match " ++ "the size in IHDR"); ++ return; ++ } ++ ++ /* The set function will do more error checking */ ++ png_set_next_frame_fcTL(png_ptr, info_ptr, width, height, ++ x_offset, y_offset, delay_num, delay_den, ++ dispose_op, blend_op); ++ ++ png_read_reinit(png_ptr, info_ptr); ++ ++ png_ptr->mode |= PNG_HAVE_fcTL; ++ } ++} ++ ++void /* PRIVATE */ ++png_have_info(png_structp png_ptr, png_infop info_ptr) ++{ ++ if((info_ptr->valid & PNG_INFO_acTL) && !(info_ptr->valid & PNG_INFO_fcTL)) ++ { ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ info_ptr->num_frames++; ++ } ++} ++ ++void /* PRIVATE */ ++png_handle_fdAT(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) ++{ ++ png_ensure_sequence_number(png_ptr, length); ++ ++ /* This function is only called from png_read_end(), png_read_info(), ++ * and png_push_read_chunk() which means that: ++ * - the user doesn't want to read this frame ++ * - or this is an out-of-place fdAT ++ * in either case it is safe to ignore the chunk with a warning */ ++ png_warning(png_ptr, "ignoring fdAT chunk"); ++ png_crc_finish(png_ptr, length - 4); ++ PNG_UNUSED(info_ptr) ++} ++ ++void /* PRIVATE */ ++png_ensure_sequence_number(png_structp png_ptr, png_uint_32 length) ++{ ++ png_byte data[4]; ++ png_uint_32 sequence_number; ++ ++ if (length < 4) ++ png_error(png_ptr, "invalid fcTL or fdAT chunk found"); ++ ++ png_crc_read(png_ptr, data, 4); ++ sequence_number = png_get_uint_31(png_ptr, data); ++ ++ if (sequence_number != png_ptr->next_seq_num) ++ png_error(png_ptr, "fcTL or fdAT chunk with out-of-order sequence " ++ "number found"); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_READ_APNG_SUPPORTED */ ++ + #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED + /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ + static int +@@ -4165,7 +4343,38 @@ + { + uInt avail_in; + png_bytep buffer; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 bytes_to_skip = 0; ++ ++ while (png_ptr->idat_size == 0 || bytes_to_skip != 0) ++ { ++ png_crc_finish(png_ptr, bytes_to_skip); ++ bytes_to_skip = 0; + ++ png_ptr->idat_size = png_read_chunk_header(png_ptr); ++ if (png_ptr->num_frames_read == 0) ++ { ++ if (png_ptr->chunk_name != png_IDAT) ++ png_error(png_ptr, "Not enough image data"); ++ } ++ else ++ { ++ if (png_ptr->chunk_name == png_IEND) ++ png_error(png_ptr, "Not enough image data"); ++ if (png_ptr->chunk_name != png_fdAT) ++ { ++ png_warning(png_ptr, "Skipped (ignored) a chunk " ++ "between APNG chunks"); ++ bytes_to_skip = png_ptr->idat_size; ++ continue; ++ } ++ ++ png_ensure_sequence_number(png_ptr, png_ptr->idat_size); ++ ++ png_ptr->idat_size -= 4; ++ } ++ } ++#else + while (png_ptr->idat_size == 0) + { + png_crc_finish(png_ptr, 0); +@@ -4177,7 +4386,7 @@ + if (png_ptr->chunk_name != png_IDAT) + png_error(png_ptr, "Not enough image data"); + } +- ++#endif /* PNG_READ_APNG_SUPPORTED */ + avail_in = png_ptr->IDAT_read_size; + + if (avail_in > png_ptr->idat_size) +@@ -4240,6 +4449,9 @@ + + png_ptr->mode |= PNG_AFTER_IDAT; + png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_ptr->num_frames_read++; ++#endif + + if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) + png_chunk_benign_error(png_ptr, "Extra compressed data"); +@@ -4678,4 +4890,80 @@ + + png_ptr->flags |= PNG_FLAG_ROW_INIT; + } ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++/* This function is to be called after the main IDAT set has been read and ++ * before a new IDAT is read. It resets some parts of png_ptr ++ * to make them usable by the read functions again */ ++void /* PRIVATE */ ++png_read_reset(png_structp png_ptr) ++{ ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++ png_ptr->mode &= ~PNG_AFTER_IDAT; ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++} ++ ++void /* PRIVATE */ ++png_read_reinit(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_ptr->width = info_ptr->next_frame_width; ++ png_ptr->height = info_ptr->next_frame_height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth,png_ptr->width); ++ png_ptr->info_rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, ++ png_ptr->width); ++ if (png_ptr->prev_row) ++ memset(png_ptr->prev_row, 0, png_ptr->rowbytes + 1); ++} ++ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++/* same as png_read_reset() but for the progressive reader */ ++void /* PRIVATE */ ++png_progressive_read_reset(png_structp png_ptr) ++{ ++#ifdef PNG_READ_INTERLACING_SUPPORTED ++ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ ++ ++ /* Start of interlace block */ ++ const int png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; ++ ++ /* Offset to next interlace block */ ++ const int png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; ++ ++ /* Start of interlace block in the y direction */ ++ const int png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; ++ ++ /* Offset to next interlace block in the y direction */ ++ const int png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; ++ ++ if (png_ptr->interlaced) ++ { ++ if (!(png_ptr->transformations & PNG_INTERLACE)) ++ png_ptr->num_rows = (png_ptr->height + png_pass_yinc[0] - 1 - ++ png_pass_ystart[0]) / png_pass_yinc[0]; ++ else ++ png_ptr->num_rows = png_ptr->height; ++ ++ png_ptr->iwidth = (png_ptr->width + ++ png_pass_inc[png_ptr->pass] - 1 - ++ png_pass_start[png_ptr->pass]) / ++ png_pass_inc[png_ptr->pass]; ++ } ++ else ++#endif /* PNG_READ_INTERLACING_SUPPORTED */ ++ { ++ png_ptr->num_rows = png_ptr->height; ++ png_ptr->iwidth = png_ptr->width; ++ } ++ png_ptr->flags &= ~PNG_FLAG_ZSTREAM_ENDED; ++ if (inflateReset(&(png_ptr->zstream)) != Z_OK) ++ png_error(png_ptr, "inflateReset failed"); ++ png_ptr->zstream.avail_in = 0; ++ png_ptr->zstream.next_in = 0; ++ png_ptr->zstream.next_out = png_ptr->row_buf; ++ png_ptr->zstream.avail_out = (uInt)PNG_ROWBYTES(png_ptr->pixel_depth, ++ png_ptr->iwidth) + 1; ++} ++#endif /* PNG_PROGRESSIVE_READ_SUPPORTED */ ++#endif /* PNG_READ_APNG_SUPPORTED */ + #endif /* READ */ +diff -Naru libpng-1.6.37.org/pngset.c libpng-1.6.37/pngset.c +--- libpng-1.6.37.org/pngset.c 2019-04-19 07:21:37.401024761 +0900 ++++ libpng-1.6.37/pngset.c 2019-04-19 07:22:37.858245798 +0900 +@@ -288,6 +288,11 @@ + info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); + + info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); ++ ++#ifdef PNG_APNG_SUPPORTED ++ /* for non-animated png. this may be overwritten from an acTL chunk later */ ++ info_ptr->num_frames = 1; ++#endif + } + + #ifdef PNG_oFFs_SUPPORTED +@@ -1158,6 +1163,147 @@ + } + #endif /* sPLT */ + ++#ifdef PNG_APNG_SUPPORTED ++png_uint_32 PNGAPI ++png_set_acTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_debug1(1, "in %s storage function", "acTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_acTL() with NULL png_ptr " ++ "or info_ptr ignored"); ++ return (0); ++ } ++ if (num_frames == 0) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames zero"); ++ return (0); ++ } ++ if (num_frames > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_frames > 2^31-1"); ++ return (0); ++ } ++ if (num_plays > PNG_UINT_31_MAX) ++ { ++ png_warning(png_ptr, ++ "Ignoring attempt to set acTL with num_plays " ++ "> 2^31-1"); ++ return (0); ++ } ++ ++ info_ptr->num_frames = num_frames; ++ info_ptr->num_plays = num_plays; ++ ++ info_ptr->valid |= PNG_INFO_acTL; ++ ++ return (1); ++} ++ ++/* delay_num and delay_den can hold any 16-bit values including zero */ ++png_uint_32 PNGAPI ++png_set_next_frame_fcTL(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ png_debug1(1, "in %s storage function", "fcTL"); ++ ++ if (png_ptr == NULL || info_ptr == NULL) ++ { ++ png_warning(png_ptr, ++ "Call to png_set_fcTL() with NULL png_ptr or info_ptr " ++ "ignored"); ++ return (0); ++ } ++ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ if (blend_op == PNG_BLEND_OP_OVER) ++ { ++ if (!(png_ptr->color_type & PNG_COLOR_MASK_ALPHA) && ++ !(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))) ++ { ++ png_warning(png_ptr, "PNG_BLEND_OP_OVER is meaningless " ++ "and wasteful for opaque images, ignored"); ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++ } ++ ++ info_ptr->next_frame_width = width; ++ info_ptr->next_frame_height = height; ++ info_ptr->next_frame_x_offset = x_offset; ++ info_ptr->next_frame_y_offset = y_offset; ++ info_ptr->next_frame_delay_num = delay_num; ++ info_ptr->next_frame_delay_den = delay_den; ++ info_ptr->next_frame_dispose_op = dispose_op; ++ info_ptr->next_frame_blend_op = blend_op; ++ ++ info_ptr->valid |= PNG_INFO_fcTL; ++ ++ return (1); ++} ++ ++void /* PRIVATE */ ++png_ensure_fcTL_is_valid(png_structp png_ptr, ++ png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, ++ png_byte dispose_op, png_byte blend_op) ++{ ++ if (width == 0 || width > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid width in fcTL (> 2^31-1)"); ++ if (height == 0 || height > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid height in fcTL (> 2^31-1)"); ++ if (x_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid x_offset in fcTL (> 2^31-1)"); ++ if (y_offset > PNG_UINT_31_MAX) ++ png_error(png_ptr, "invalid y_offset in fcTL (> 2^31-1)"); ++ if (width + x_offset > png_ptr->first_frame_width || ++ height + y_offset > png_ptr->first_frame_height) ++ png_error(png_ptr, "dimensions of a frame are greater than" ++ "the ones in IHDR"); ++ ++ if (dispose_op != PNG_DISPOSE_OP_NONE && ++ dispose_op != PNG_DISPOSE_OP_BACKGROUND && ++ dispose_op != PNG_DISPOSE_OP_PREVIOUS) ++ png_error(png_ptr, "invalid dispose_op in fcTL"); ++ ++ if (blend_op != PNG_BLEND_OP_SOURCE && ++ blend_op != PNG_BLEND_OP_OVER) ++ png_error(png_ptr, "invalid blend_op in fcTL"); ++ ++ PNG_UNUSED(delay_num) ++ PNG_UNUSED(delay_den) ++} ++ ++png_uint_32 PNGAPI ++png_set_first_frame_is_hidden(png_structp png_ptr, png_infop info_ptr, ++ png_byte is_hidden) ++{ ++ png_debug(1, "in png_first_frame_is_hidden()"); ++ ++ if (png_ptr == NULL) ++ return 0; ++ ++ if (is_hidden) ++ png_ptr->apng_flags |= PNG_FIRST_FRAME_HIDDEN; ++ else ++ png_ptr->apng_flags &= ~PNG_FIRST_FRAME_HIDDEN; ++ ++ PNG_UNUSED(info_ptr) ++ ++ return 1; ++} ++#endif /* PNG_APNG_SUPPORTED */ ++ + #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED + static png_byte + check_location(png_const_structrp png_ptr, int location) +diff -Naru libpng-1.6.37.org/pngstruct.h libpng-1.6.37/pngstruct.h +--- libpng-1.6.37.org/pngstruct.h 2019-04-19 07:21:37.401024761 +0900 ++++ libpng-1.6.37/pngstruct.h 2019-04-19 07:22:37.854245849 +0900 +@@ -409,6 +409,27 @@ + png_byte filter_type; + #endif + ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 apng_flags; ++ png_uint_32 next_seq_num; /* next fcTL/fdAT chunk sequence number */ ++ png_uint_32 first_frame_width; ++ png_uint_32 first_frame_height; ++ ++#ifdef PNG_READ_APNG_SUPPORTED ++ png_uint_32 num_frames_read; /* incremented after all image data of */ ++ /* a frame is read */ ++#ifdef PNG_PROGRESSIVE_READ_SUPPORTED ++ png_progressive_frame_ptr frame_info_fn; /* frame info read callback */ ++ png_progressive_frame_ptr frame_end_fn; /* frame data read callback */ ++#endif ++#endif ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_uint_32 num_frames_to_write; ++ png_uint_32 num_frames_written; ++#endif ++#endif /* PNG_APNG_SUPPORTED */ ++ + /* New members added in libpng-1.2.0 */ + + /* New members added in libpng-1.0.2 but first enabled by default in 1.2.0 */ +diff -Naru libpng-1.6.37.org/pngtest.c libpng-1.6.37/pngtest.c +--- libpng-1.6.37.org/pngtest.c 2019-04-19 07:21:37.401024761 +0900 ++++ libpng-1.6.37/pngtest.c 2019-04-19 07:22:37.854245849 +0900 +@@ -875,6 +875,10 @@ + volatile int num_passes; + int pass; + int bit_depth, color_type; ++#ifdef PNG_APNG_SUPPORTED ++ png_uint_32 num_frames; ++ png_uint_32 num_plays; ++#endif + + row_buf = NULL; + error_parameters.file_name = inname; +@@ -1383,6 +1387,22 @@ + } + } + #endif ++ ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ if (png_get_acTL(read_ptr, read_info_ptr, &num_frames, &num_plays)) ++ { ++ png_byte is_hidden; ++ pngtest_debug2("Handling acTL chunks (frames %ld, plays %ld)", ++ num_frames, num_plays); ++ png_set_acTL(write_ptr, write_info_ptr, num_frames, num_plays); ++ is_hidden = png_get_first_frame_is_hidden(read_ptr, read_info_ptr); ++ png_set_first_frame_is_hidden(write_ptr, write_info_ptr, is_hidden); ++ } ++ } ++#endif ++ + #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + { + png_unknown_chunkp unknowns; +@@ -1463,6 +1483,110 @@ + t_misc += (t_stop - t_start); + t_start = t_stop; + #endif ++#ifdef PNG_APNG_SUPPORTED ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_acTL)) ++ { ++ png_uint_32 frame; ++ for (frame = 0; frame < num_frames; frame++) ++ { ++ png_uint_32 frame_width; ++ png_uint_32 frame_height; ++ png_uint_32 x_offset; ++ png_uint_32 y_offset; ++ png_uint_16 delay_num; ++ png_uint_16 delay_den; ++ png_byte dispose_op; ++ png_byte blend_op; ++ png_read_frame_head(read_ptr, read_info_ptr); ++ if (png_get_valid(read_ptr, read_info_ptr, PNG_INFO_fcTL)) ++ { ++ png_get_next_frame_fcTL(read_ptr, read_info_ptr, ++ &frame_width, &frame_height, ++ &x_offset, &y_offset, ++ &delay_num, &delay_den, ++ &dispose_op, &blend_op); ++ } ++ else ++ { ++ frame_width = width; ++ frame_height = height; ++ x_offset = 0; ++ y_offset = 0; ++ delay_num = 1; ++ delay_den = 1; ++ dispose_op = PNG_DISPOSE_OP_NONE; ++ blend_op = PNG_BLEND_OP_SOURCE; ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_head(write_ptr, write_info_ptr, (png_bytepp)&row_buf, ++ frame_width, frame_height, ++ x_offset, y_offset, ++ delay_num, delay_den, ++ dispose_op, blend_op); ++#endif ++ for (pass = 0; pass < num_passes; pass++) ++ { ++# ifdef calc_pass_height ++ png_uint_32 pass_height; ++ ++ if (num_passes == 7) /* interlaced */ ++ { ++ if (PNG_PASS_COLS(frame_width, pass) > 0) ++ pass_height = PNG_PASS_ROWS(frame_height, pass); ++ ++ else ++ pass_height = 0; ++ } ++ ++ else /* not interlaced */ ++ pass_height = frame_height; ++# else ++# define pass_height frame_height ++# endif ++ ++ pngtest_debug1("Writing row data for pass %d", pass); ++ for (y = 0; y < pass_height; y++) ++ { ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Allocating row buffer (pass %d, y = %u)...", pass, y); ++ ++ row_buf = (png_bytep)png_malloc(read_ptr, ++ png_get_rowbytes(read_ptr, read_info_ptr)); ++ ++ pngtest_debug2("\t0x%08lx (%lu bytes)", (unsigned long)row_buf, ++ (unsigned long)png_get_rowbytes(read_ptr, read_info_ptr)); ++ ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ png_read_rows(read_ptr, (png_bytepp)&row_buf, NULL, 1); ++ ++#ifdef PNG_WRITE_SUPPORTED ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_decode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++ png_write_rows(write_ptr, (png_bytepp)&row_buf, 1); ++#ifdef PNGTEST_TIMING ++ t_stop = (float)clock(); ++ t_encode += (t_stop - t_start); ++ t_start = t_stop; ++#endif ++#endif /* PNG_WRITE_SUPPORTED */ ++ ++#ifndef SINGLE_ROWBUF_ALLOC ++ pngtest_debug2("Freeing row buffer (pass %d, y = %u)", pass, y); ++ png_free(read_ptr, row_buf); ++ row_buf = NULL; ++#endif /* !SINGLE_ROWBUF_ALLOC */ ++ } ++ } ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_write_frame_tail(write_ptr, write_info_ptr); ++#endif ++ } ++ } ++ else ++#endif + for (pass = 0; pass < num_passes; pass++) + { + # ifdef calc_pass_height +diff -Naru libpng-1.6.37.org/pngwrite.c libpng-1.6.37/pngwrite.c +--- libpng-1.6.37.org/pngwrite.c 2019-04-19 07:21:37.402024748 +0900 ++++ libpng-1.6.37/pngwrite.c 2019-04-19 07:22:37.855245836 +0900 +@@ -128,6 +128,10 @@ + * the application continues writing the PNG. So check the 'invalid' + * flag here too. + */ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (info_ptr->valid & PNG_INFO_acTL) ++ png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); ++#endif + #ifdef PNG_GAMMA_SUPPORTED + # ifdef PNG_WRITE_gAMA_SUPPORTED + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && +@@ -370,6 +374,11 @@ + png_benign_error(png_ptr, "Wrote palette index exceeding num_palette"); + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ if (png_ptr->num_frames_written != png_ptr->num_frames_to_write) ++ png_error(png_ptr, "Not enough frames written"); ++#endif ++ + /* See if user wants us to write information chunks */ + if (info_ptr != NULL) + { +@@ -1461,6 +1470,43 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void PNGAPI ++png_write_frame_head(png_structp png_ptr, png_infop info_ptr, ++ png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_debug(1, "in png_write_frame_head"); ++ ++ /* there is a chance this has been set after png_write_info was called, ++ * so it would be set but not written. is there a way to be sure? */ ++ if (!(info_ptr->valid & PNG_INFO_acTL)) ++ png_error(png_ptr, "png_write_frame_head(): acTL not set"); ++ ++ png_write_reset(png_ptr); ++ ++ png_write_reinit(png_ptr, info_ptr, width, height); ++ ++ if ( !(png_ptr->num_frames_written == 0 && ++ (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ) ) ++ png_write_fcTL(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ PNG_UNUSED(row_pointers) ++} ++ ++void PNGAPI ++png_write_frame_tail(png_structp png_ptr, png_infop info_ptr) ++{ ++ png_debug(1, "in png_write_frame_tail"); ++ ++ png_ptr->num_frames_written++; ++ ++ PNG_UNUSED(info_ptr) ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + + #ifdef PNG_SIMPLIFIED_WRITE_SUPPORTED + /* Initialize the write structure - general purpose utility. */ +diff -Naru libpng-1.6.37.org/pngwutil.c libpng-1.6.37/pngwutil.c +--- libpng-1.6.37.org/pngwutil.c 2019-04-19 07:21:37.402024748 +0900 ++++ libpng-1.6.37/pngwutil.c 2019-04-19 07:22:37.867245682 +0900 +@@ -821,6 +821,11 @@ + /* Write the chunk */ + png_write_complete_chunk(png_ptr, png_IHDR, buf, 13); + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ png_ptr->first_frame_width = width; ++ png_ptr->first_frame_height = height; ++#endif ++ + if ((png_ptr->do_filter) == PNG_NO_FILTERS) + { + if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || +@@ -1002,8 +1007,17 @@ + optimize_cmf(data, png_image_size(png_ptr)); + #endif + +- if (size > 0) +- png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++ if (size > 0) ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ { ++ if (png_ptr->num_frames_written == 0) ++#endif ++ png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++ } ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + png_ptr->mode |= PNG_HAVE_IDAT; + + png_ptr->zstream.next_out = data; +@@ -1050,7 +1064,17 @@ + #endif + + if (size > 0) ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ { ++ if (png_ptr->num_frames_written == 0) ++#endif + png_write_complete_chunk(png_ptr, png_IDAT, data, size); ++#ifdef PNG_WRITE_APNG_SUPPORTED ++ else ++ png_write_fdAT(png_ptr, data, size); ++ } ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + png_ptr->zstream.avail_out = 0; + png_ptr->zstream.next_out = NULL; + png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; +@@ -1885,6 +1909,82 @@ + } + #endif + ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_acTL(png_structp png_ptr, ++ png_uint_32 num_frames, png_uint_32 num_plays) ++{ ++ png_byte buf[8]; ++ ++ png_debug(1, "in png_write_acTL"); ++ ++ png_ptr->num_frames_to_write = num_frames; ++ ++ if (png_ptr->apng_flags & PNG_FIRST_FRAME_HIDDEN) ++ num_frames--; ++ ++ png_save_uint_32(buf, num_frames); ++ png_save_uint_32(buf + 4, num_plays); ++ ++ png_write_complete_chunk(png_ptr, png_acTL, buf, (png_size_t)8); ++} ++ ++void /* PRIVATE */ ++png_write_fcTL(png_structp png_ptr, png_uint_32 width, png_uint_32 height, ++ png_uint_32 x_offset, png_uint_32 y_offset, ++ png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, ++ png_byte blend_op) ++{ ++ png_byte buf[26]; ++ ++ png_debug(1, "in png_write_fcTL"); ++ ++ if (png_ptr->num_frames_written == 0 && (x_offset != 0 || y_offset != 0)) ++ png_error(png_ptr, "x and/or y offset for the first frame aren't 0"); ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ ++ /* more error checking */ ++ png_ensure_fcTL_is_valid(png_ptr, width, height, x_offset, y_offset, ++ delay_num, delay_den, dispose_op, blend_op); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_save_uint_32(buf + 4, width); ++ png_save_uint_32(buf + 8, height); ++ png_save_uint_32(buf + 12, x_offset); ++ png_save_uint_32(buf + 16, y_offset); ++ png_save_uint_16(buf + 20, delay_num); ++ png_save_uint_16(buf + 22, delay_den); ++ buf[24] = dispose_op; ++ buf[25] = blend_op; ++ ++ png_write_complete_chunk(png_ptr, png_fcTL, buf, (png_size_t)26); ++ ++ png_ptr->next_seq_num++; ++} ++ ++void /* PRIVATE */ ++png_write_fdAT(png_structp png_ptr, ++ png_const_bytep data, png_size_t length) ++{ ++ png_byte buf[4]; ++ ++ png_write_chunk_header(png_ptr, png_fdAT, (png_uint_32)(4 + length)); ++ ++ png_save_uint_32(buf, png_ptr->next_seq_num); ++ png_write_chunk_data(png_ptr, buf, 4); ++ ++ png_write_chunk_data(png_ptr, data, length); ++ ++ png_write_chunk_end(png_ptr); ++ ++ png_ptr->next_seq_num++; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ ++ + /* Initializes the row writing capability of libpng */ + void /* PRIVATE */ + png_write_start_row(png_structrp png_ptr) +@@ -2778,4 +2878,39 @@ + } + #endif /* WRITE_FLUSH */ + } ++ ++#ifdef PNG_WRITE_APNG_SUPPORTED ++void /* PRIVATE */ ++png_write_reset(png_structp png_ptr) ++{ ++ png_ptr->row_number = 0; ++ png_ptr->pass = 0; ++ png_ptr->mode &= ~PNG_HAVE_IDAT; ++} ++ ++void /* PRIVATE */ ++png_write_reinit(png_structp png_ptr, png_infop info_ptr, ++ png_uint_32 width, png_uint_32 height) ++{ ++ if (png_ptr->num_frames_written == 0 && ++ (width != png_ptr->first_frame_width || ++ height != png_ptr->first_frame_height)) ++ png_error(png_ptr, "width and/or height in the first frame's fcTL " ++ "don't match the ones in IHDR"); ++ if (width > png_ptr->first_frame_width || ++ height > png_ptr->first_frame_height) ++ png_error(png_ptr, "width and/or height for a frame greater than" ++ "the ones in IHDR"); ++ ++ png_set_IHDR(png_ptr, info_ptr, width, height, ++ info_ptr->bit_depth, info_ptr->color_type, ++ info_ptr->interlace_type, info_ptr->compression_type, ++ info_ptr->filter_type); ++ ++ png_ptr->width = width; ++ png_ptr->height = height; ++ png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, width); ++ png_ptr->usr_width = png_ptr->width; ++} ++#endif /* PNG_WRITE_APNG_SUPPORTED */ + #endif /* WRITE */ +diff -Naru libpng-1.6.37.org/scripts/symbols.def libpng-1.6.37/scripts/symbols.def +--- libpng-1.6.37.org/scripts/symbols.def 2019-04-19 07:21:37.405024710 +0900 ++++ libpng-1.6.37/scripts/symbols.def 2019-04-19 07:22:37.856245823 +0900 +@@ -253,3 +253,23 @@ + png_set_eXIf @247 + png_get_eXIf_1 @248 + png_set_eXIf_1 @249 ++ png_get_acTL @250 ++ png_set_acTL @251 ++ png_get_num_frames @252 ++ png_get_num_plays @253 ++ png_get_next_frame_fcTL @254 ++ png_set_next_frame_fcTL @255 ++ png_get_next_frame_width @256 ++ png_get_next_frame_height @257 ++ png_get_next_frame_x_offset @258 ++ png_get_next_frame_y_offset @259 ++ png_get_next_frame_delay_num @260 ++ png_get_next_frame_delay_den @261 ++ png_get_next_frame_dispose_op @262 ++ png_get_next_frame_blend_op @263 ++ png_get_first_frame_is_hidden @264 ++ png_set_first_frame_is_hidden @265 ++ png_read_frame_head @266 ++ png_set_progressive_frame_fn @267 ++ png_write_frame_head @268 ++ png_write_frame_tail @269 diff --git a/repo/system/libpng/libpng.xibuild b/repo/system/libpng/libpng.xibuild new file mode 100644 index 0000000..e40077d --- /dev/null +++ b/repo/system/libpng/libpng.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="" + +PKG_VER=1.6.37 +SOURCE=https://downloads.sourceforge.net/libpng/libpng-$PKG_VER.tar.xz +DESC="A collection of routines used to create PNG images" +ADDITIONAL="libpng-1.6.37-apng.patch" + +prepare () { + apply_patches +} + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install + mkdir -p $PKG_DEST/usr/share/doc/libpng-$PKG_VER && + cp README libpng-manual.txt $PKG_DEST/usr/share/doc/libpng-$PKG_VER + +} diff --git a/repo/system/libpsl.xibuild b/repo/system/libpsl.xibuild deleted file mode 100644 index 1ac7a34..0000000 --- a/repo/system/libpsl.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="python make " -DEPS="libidn" - -PKG_VER=0.21.1 -SOURCE=https://github.com/rockdaboot/libpsl/releases/download/$PKG_VER/libpsl-$PKG_VER.tar.gz -DESC="C library to handle the Public Suffix List" - -prepare () { - sed -i 's/env python/&3/' src/psl-make-dafsa -} - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libpsl/libpsl.xibuild b/repo/system/libpsl/libpsl.xibuild new file mode 100644 index 0000000..1ac7a34 --- /dev/null +++ b/repo/system/libpsl/libpsl.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="python make " +DEPS="libidn" + +PKG_VER=0.21.1 +SOURCE=https://github.com/rockdaboot/libpsl/releases/download/$PKG_VER/libpsl-$PKG_VER.tar.gz +DESC="C library to handle the Public Suffix List" + +prepare () { + sed -i 's/env python/&3/' src/psl-make-dafsa +} + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libptytty.xibuild b/repo/system/libptytty.xibuild deleted file mode 100644 index bc36364..0000000 --- a/repo/system/libptytty.xibuild +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/sh - -MAKEDEPS="meson cmake" -DEPS="musl" - -PKG_VER=2.0 -SOURCE=http://dist.schmorp.de/libptytty/libptytty-$PKG_VER.tar.gz -DESC="Library for OS independent and secure pty/tty handling" - -build () { - mkdir build && - cd build && - - cmake -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_BUILD_TYPE=Release \ - -DPT_UTMP_FILE:STRING=/run/utmp \ - .. && - make - -} - -package () { - make DESTDIR=$PKG_DEST install - mv $PKG_DEST/usr/lib64 $PKG_DEST/usr/lib -} diff --git a/repo/system/libptytty/libptytty.xibuild b/repo/system/libptytty/libptytty.xibuild new file mode 100644 index 0000000..bc36364 --- /dev/null +++ b/repo/system/libptytty/libptytty.xibuild @@ -0,0 +1,25 @@ +#!/bin/sh + +MAKEDEPS="meson cmake" +DEPS="musl" + +PKG_VER=2.0 +SOURCE=http://dist.schmorp.de/libptytty/libptytty-$PKG_VER.tar.gz +DESC="Library for OS independent and secure pty/tty handling" + +build () { + mkdir build && + cd build && + + cmake -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DPT_UTMP_FILE:STRING=/run/utmp \ + .. && + make + +} + +package () { + make DESTDIR=$PKG_DEST install + mv $PKG_DEST/usr/lib64 $PKG_DEST/usr/lib +} diff --git a/repo/system/libqmi.xibuild b/repo/system/libqmi.xibuild deleted file mode 100644 index 7439f1f..0000000 --- a/repo/system/libqmi.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make gtk-doc glib libgudev " -DEPS="musl libqrtr libmbim " - -PKG_VER=1.30.4 -SOURCE=https://www.freedesktop.org/software/libqmi/libqmi-$PKG_VER.tar.xz -DESC="QMI modem protocol helper library" - -build () { - ./configure \ - --build=$CBUILD \ - --host=$CHOST \ - --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-static \ - --enable-mbim-qmux \ - --enable-qrtr \ - --enable-gtk-doc - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libqmi/libqmi.xibuild b/repo/system/libqmi/libqmi.xibuild new file mode 100644 index 0000000..7439f1f --- /dev/null +++ b/repo/system/libqmi/libqmi.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="make gtk-doc glib libgudev " +DEPS="musl libqrtr libmbim " + +PKG_VER=1.30.4 +SOURCE=https://www.freedesktop.org/software/libqmi/libqmi-$PKG_VER.tar.xz +DESC="QMI modem protocol helper library" + +build () { + ./configure \ + --build=$CBUILD \ + --host=$CHOST \ + --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-static \ + --enable-mbim-qmux \ + --enable-qrtr \ + --enable-gtk-doc + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libqrtr.xibuild b/repo/system/libqrtr.xibuild deleted file mode 100644 index 7c4de5a..0000000 --- a/repo/system/libqrtr.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="glib gobject-introspection gtk-doc linux-headers meson" -DEPS="musl glib" - -PKG_VER=1.2.2 -SOURCE=https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib/-/archive/$PKG_VER/libqrtr-glib-$PKG_VER.tar.gz -DESC="Qualcomm IPC Router protocol helper library" - -build () { - mkdir build && - cd build - meson --prefix=/usr .. - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} diff --git a/repo/system/libqrtr/libqrtr.xibuild b/repo/system/libqrtr/libqrtr.xibuild new file mode 100644 index 0000000..7c4de5a --- /dev/null +++ b/repo/system/libqrtr/libqrtr.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="glib gobject-introspection gtk-doc linux-headers meson" +DEPS="musl glib" + +PKG_VER=1.2.2 +SOURCE=https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib/-/archive/$PKG_VER/libqrtr-glib-$PKG_VER.tar.gz +DESC="Qualcomm IPC Router protocol helper library" + +build () { + mkdir build && + cd build + meson --prefix=/usr .. + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} diff --git a/repo/system/libretls.xibuild b/repo/system/libretls.xibuild deleted file mode 100644 index 97b31af..0000000 --- a/repo/system/libretls.xibuild +++ /dev/null @@ -1,31 +0,0 @@ -#!/bin/sh - -NAME="libretls" -DESC="port of libtls from libressl to openssl" - -MAKEDEPS="make " -DEPS="openssl cacerts " - -PKG_VER=3.5.1 -SOURCE="https://causal.agency/libretls/libretls-$PKG_VER.tar.gz" - -prepare () { - local _current _rev _age - IFS=: read _current _rev _age < LIBTLS_VERSION - printf "%d:%d:%d\n" $(( $_current - 18 )) $_rev $_age > LIBTLS_VERSION - - autoreconf -} - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libretls/libretls.xibuild b/repo/system/libretls/libretls.xibuild new file mode 100644 index 0000000..97b31af --- /dev/null +++ b/repo/system/libretls/libretls.xibuild @@ -0,0 +1,31 @@ +#!/bin/sh + +NAME="libretls" +DESC="port of libtls from libressl to openssl" + +MAKEDEPS="make " +DEPS="openssl cacerts " + +PKG_VER=3.5.1 +SOURCE="https://causal.agency/libretls/libretls-$PKG_VER.tar.gz" + +prepare () { + local _current _rev _age + IFS=: read _current _rev _age < LIBTLS_VERSION + printf "%d:%d:%d\n" $(( $_current - 18 )) $_rev $_age > LIBTLS_VERSION + + autoreconf +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libretls/test_program.c b/repo/system/libretls/test_program.c new file mode 100644 index 0000000..f8d7332 --- /dev/null +++ b/repo/system/libretls/test_program.c @@ -0,0 +1,11 @@ +#include +#include +#include + +int +main(int argc, const char *argv[]) +{ + assert(tls_init() == 0); + + return EXIT_SUCCESS; +} diff --git a/repo/system/libsasl.xibuild b/repo/system/libsasl.xibuild deleted file mode 100644 index 5c55e31..0000000 --- a/repo/system/libsasl.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="gmp" - -PKG_VER=2.1.27 -SOURCE=https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-$PKG_VER/cyrus-sasl-$PKG_VER.tar.gz -DESC="A library for Simple Authentication and Security Layer" - -build () { - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libsasl/libsasl.xibuild b/repo/system/libsasl/libsasl.xibuild new file mode 100644 index 0000000..5c55e31 --- /dev/null +++ b/repo/system/libsasl/libsasl.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="gmp" + +PKG_VER=2.1.27 +SOURCE=https://github.com/cyrusimap/cyrus-sasl/releases/download/cyrus-sasl-$PKG_VER/cyrus-sasl-$PKG_VER.tar.gz +DESC="A library for Simple Authentication and Security Layer" + +build () { + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libseccomp.xibuild b/repo/system/libseccomp.xibuild deleted file mode 100644 index 5e05d58..0000000 --- a/repo/system/libseccomp.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.5.3 -SOURCE=https://github.com/seccomp/libseccomp/releases/download/v$PKG_VER/libseccomp-$PKG_VER.tar.gz - -DESC="Enhanced seccomp library" - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -#check () { - #make check -#} - -package () { - make prefix=/usr lib=lib DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libseccomp/libseccomp.xibuild b/repo/system/libseccomp/libseccomp.xibuild new file mode 100644 index 0000000..5e05d58 --- /dev/null +++ b/repo/system/libseccomp/libseccomp.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.5.3 +SOURCE=https://github.com/seccomp/libseccomp/releases/download/v$PKG_VER/libseccomp-$PKG_VER.tar.gz + +DESC="Enhanced seccomp library" + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +#check () { + #make check +#} + +package () { + make prefix=/usr lib=lib DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libsigsegv.xibuild b/repo/system/libsigsegv.xibuild deleted file mode 100644 index 15fd491..0000000 --- a/repo/system/libsigsegv.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="libtasn1 readline zlib nettle libp11-kit libidn libunistring" - -PKG_VER=2.13 -SOURCE=https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-$PKG_VER.tar.gz -DESC="A library for handling page faults in user mode" - -build () { - ./configure \ - --prefix=/usr --enable-shared --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libsigsegv/libsigsegv.xibuild b/repo/system/libsigsegv/libsigsegv.xibuild new file mode 100644 index 0000000..15fd491 --- /dev/null +++ b/repo/system/libsigsegv/libsigsegv.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="libtasn1 readline zlib nettle libp11-kit libidn libunistring" + +PKG_VER=2.13 +SOURCE=https://ftp.gnu.org/gnu/libsigsegv/libsigsegv-$PKG_VER.tar.gz +DESC="A library for handling page faults in user mode" + +build () { + ./configure \ + --prefix=/usr --enable-shared --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libssh2.xibuild b/repo/system/libssh2.xibuild deleted file mode 100644 index ebf8cdf..0000000 --- a/repo/system/libssh2.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="openssl openssh libgcrypt zlib" - -PKG_VER=1.10.0 -SOURCE=https://www.libssh2.org/download/libssh2-$PKG_VER.tar.gz -DESC="A client-side C library implementing the SSH2 protocol" - -prepare () { - ./configure --prefix=/usr --disable-static -} - -build () { - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libssh2/libssh2.xibuild b/repo/system/libssh2/libssh2.xibuild new file mode 100644 index 0000000..ebf8cdf --- /dev/null +++ b/repo/system/libssh2/libssh2.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="openssl openssh libgcrypt zlib" + +PKG_VER=1.10.0 +SOURCE=https://www.libssh2.org/download/libssh2-$PKG_VER.tar.gz +DESC="A client-side C library implementing the SSH2 protocol" + +prepare () { + ./configure --prefix=/usr --disable-static +} + +build () { + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libtasn1.xibuild b/repo/system/libtasn1.xibuild deleted file mode 100644 index a2394ed..0000000 --- a/repo/system/libtasn1.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=4.18.0 -SOURCE=https://ftp.gnu.org/gnu/libtasn1/libtasn1-$PKG_VER.tar.gz -DESC="The ASN.1 library used in GNUTLS" - -build () { - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libtasn1/libtasn1.xibuild b/repo/system/libtasn1/libtasn1.xibuild new file mode 100644 index 0000000..a2394ed --- /dev/null +++ b/repo/system/libtasn1/libtasn1.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=4.18.0 +SOURCE=https://ftp.gnu.org/gnu/libtasn1/libtasn1-$PKG_VER.tar.gz +DESC="The ASN.1 library used in GNUTLS" + +build () { + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libtermkey.xibuild b/repo/system/libtermkey.xibuild deleted file mode 100644 index b73a16e..0000000 --- a/repo/system/libtermkey.xibuild +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=0.22 -SOURCE=http://www.leonerd.org.uk/code/libtermkey/libtermkey-$PKG_VER.tar.gz -DESC="Library for easy processing of keyboard entry from terminal-based programs" - -build () { - make PREFIX=/usr -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libtermkey/libtermkey.xibuild b/repo/system/libtermkey/libtermkey.xibuild new file mode 100644 index 0000000..b73a16e --- /dev/null +++ b/repo/system/libtermkey/libtermkey.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=0.22 +SOURCE=http://www.leonerd.org.uk/code/libtermkey/libtermkey-$PKG_VER.tar.gz +DESC="Library for easy processing of keyboard entry from terminal-based programs" + +build () { + make PREFIX=/usr +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libtirpc.xibuild b/repo/system/libtirpc.xibuild deleted file mode 100644 index ec4f3b9..0000000 --- a/repo/system/libtirpc.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make queue-standalone" -DEPS="krb5" - -PKG_VER=1.3.2 -SOURCE=https://downloads.sourceforge.net/libtirpc/libtirpc-$PKG_VER.tar.bz2 -DESC="Transport Independent RPC library (SunRPC replacement)" - -ADDITIONAL=" -https://git.alpinelinux.org/aports/plain/main/libtirpc/soname-suffix.patch -" - -prepare () { - apply_patches - autoreconf -fi -} - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libtirpc/libtirpc.xibuild b/repo/system/libtirpc/libtirpc.xibuild new file mode 100644 index 0000000..ec4f3b9 --- /dev/null +++ b/repo/system/libtirpc/libtirpc.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +MAKEDEPS="make queue-standalone" +DEPS="krb5" + +PKG_VER=1.3.2 +SOURCE=https://downloads.sourceforge.net/libtirpc/libtirpc-$PKG_VER.tar.bz2 +DESC="Transport Independent RPC library (SunRPC replacement)" + +ADDITIONAL=" +https://git.alpinelinux.org/aports/plain/main/libtirpc/soname-suffix.patch +" + +prepare () { + apply_patches + autoreconf -fi +} + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libtool.xibuild b/repo/system/libtool.xibuild deleted file mode 100644 index c97257c..0000000 --- a/repo/system/libtool.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="sh tar musl" - -PKG_VER=2.4.6 -SOURCE=https://ftpmirror.gnu.org/libtool/libtool-$PKG_VER.tar.gz -DESC="A generic library support script" - -build () { - ./configure --prefix=/usr - make -} - -#check () { - ## one test with older libltdl interfaces failed - #make check || true -#} - -package () { - make DESTDIR=$PKG_DEST install - rm -f $PKG_DEST/usr/lib/libltdl.a -} diff --git a/repo/system/libtool/libtool.xibuild b/repo/system/libtool/libtool.xibuild new file mode 100644 index 0000000..c97257c --- /dev/null +++ b/repo/system/libtool/libtool.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="sh tar musl" + +PKG_VER=2.4.6 +SOURCE=https://ftpmirror.gnu.org/libtool/libtool-$PKG_VER.tar.gz +DESC="A generic library support script" + +build () { + ./configure --prefix=/usr + make +} + +#check () { + ## one test with older libltdl interfaces failed + #make check || true +#} + +package () { + make DESTDIR=$PKG_DEST install + rm -f $PKG_DEST/usr/lib/libltdl.a +} diff --git a/repo/system/libunistring.xibuild b/repo/system/libunistring.xibuild deleted file mode 100644 index 286b0c8..0000000 --- a/repo/system/libunistring.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=0.9.10 -SOURCE=https://ftp.gnu.org/gnu/libunistring/libunistring-$PKG_VER.tar.gz -DESC="Library for manipulating Unicode strings and C strings" - -build () { - - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libunistring/libunistring.xibuild b/repo/system/libunistring/libunistring.xibuild new file mode 100644 index 0000000..286b0c8 --- /dev/null +++ b/repo/system/libunistring/libunistring.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=0.9.10 +SOURCE=https://ftp.gnu.org/gnu/libunistring/libunistring-$PKG_VER.tar.gz +DESC="Library for manipulating Unicode strings and C strings" + +build () { + + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libusb.xibuild b/repo/system/libusb.xibuild deleted file mode 100644 index 324b100..0000000 --- a/repo/system/libusb.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl eudev" - -PKG_VER=1.0.25 -SOURCE=https://github.com/libusb/libusb/releases/download/v$PKG_VER/libusb-$PKG_VER.tar.bz2 -DESC="Library that provides generic access to USB devices" - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libusb/libusb.xibuild b/repo/system/libusb/libusb.xibuild new file mode 100644 index 0000000..324b100 --- /dev/null +++ b/repo/system/libusb/libusb.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl eudev" + +PKG_VER=1.0.25 +SOURCE=https://github.com/libusb/libusb/releases/download/v$PKG_VER/libusb-$PKG_VER.tar.bz2 +DESC="Library that provides generic access to USB devices" + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libuv.xibuild b/repo/system/libuv.xibuild deleted file mode 100644 index 976b2b9..0000000 --- a/repo/system/libuv.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.44.1 -SOURCE=https://dist.libuv.org/dist/v$PKG_VER/libuv-v$PKG_VER.tar.gz -DESC="Cross-platform asychronous I/O" - -prepare () { - sh autogen.sh -} - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var - make BUILDTYPE=Release - -} - -package () { - make DESTDIR="$PKG_DEST" install -} diff --git a/repo/system/libuv/libuv.xibuild b/repo/system/libuv/libuv.xibuild new file mode 100644 index 0000000..976b2b9 --- /dev/null +++ b/repo/system/libuv/libuv.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.44.1 +SOURCE=https://dist.libuv.org/dist/v$PKG_VER/libuv-v$PKG_VER.tar.gz +DESC="Cross-platform asychronous I/O" + +prepare () { + sh autogen.sh +} + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var + make BUILDTYPE=Release + +} + +package () { + make DESTDIR="$PKG_DEST" install +} diff --git a/repo/system/libvterm.xibuild b/repo/system/libvterm.xibuild deleted file mode 100644 index d212ccc..0000000 --- a/repo/system/libvterm.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=0.1.4 -SOURCE=http://www.leonerd.org.uk/code/libvterm/libvterm-$PKG_VER.tar.gz -DESC="Abstract library implementation of a VT220/xterm/ECMA-48 terminal emulator" - -build () { - make PREFIX=/usr -} - -package () { - make PREFIX=/usr DESTDIR="$PKG_DEST/" install - rm -f $PKG_DEST/usr/lib/*.a -} diff --git a/repo/system/libvterm/libvterm.xibuild b/repo/system/libvterm/libvterm.xibuild new file mode 100644 index 0000000..d212ccc --- /dev/null +++ b/repo/system/libvterm/libvterm.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=0.1.4 +SOURCE=http://www.leonerd.org.uk/code/libvterm/libvterm-$PKG_VER.tar.gz +DESC="Abstract library implementation of a VT220/xterm/ECMA-48 terminal emulator" + +build () { + make PREFIX=/usr +} + +package () { + make PREFIX=/usr DESTDIR="$PKG_DEST/" install + rm -f $PKG_DEST/usr/lib/*.a +} diff --git a/repo/system/libxcrypt.xibuild b/repo/system/libxcrypt.xibuild deleted file mode 100644 index ec931e1..0000000 --- a/repo/system/libxcrypt.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl perl" - -PKG_VER=4.4.26 -SOURCE=https://github.com/besser82/libxcrypt/releases/download/v$PKG_VER/libxcrypt-$PKG_VER.tar.xz -DESC="A modern library for one-way hashing of passwords" - -build () { - CC=gcc ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - - diff --git a/repo/system/libxcrypt/libxcrypt.xibuild b/repo/system/libxcrypt/libxcrypt.xibuild new file mode 100644 index 0000000..ec931e1 --- /dev/null +++ b/repo/system/libxcrypt/libxcrypt.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl perl" + +PKG_VER=4.4.26 +SOURCE=https://github.com/besser82/libxcrypt/releases/download/v$PKG_VER/libxcrypt-$PKG_VER.tar.xz +DESC="A modern library for one-way hashing of passwords" + +build () { + CC=gcc ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + + diff --git a/repo/system/libxml2.xibuild b/repo/system/libxml2.xibuild deleted file mode 100644 index 9e2fd8a..0000000 --- a/repo/system/libxml2.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="python make" -DEPS="zlib readline ncurses xz icu" - -PKG_VER=2.9.12 -SOURCE=http://xmlsoft.org/sources/libxml2-$PKG_VER.tar.gz -DESC="XML parsing library" - -build () { - ./configure --prefix=/usr \ - --disable-static \ - --with-history \ - --with-python=/usr/bin/python3 && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libxml2/libxml2.xibuild b/repo/system/libxml2/libxml2.xibuild new file mode 100644 index 0000000..9e2fd8a --- /dev/null +++ b/repo/system/libxml2/libxml2.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="python make" +DEPS="zlib readline ncurses xz icu" + +PKG_VER=2.9.12 +SOURCE=http://xmlsoft.org/sources/libxml2-$PKG_VER.tar.gz +DESC="XML parsing library" + +build () { + ./configure --prefix=/usr \ + --disable-static \ + --with-history \ + --with-python=/usr/bin/python3 && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/libxslt.xibuild b/repo/system/libxslt.xibuild deleted file mode 100644 index 805925f..0000000 --- a/repo/system/libxslt.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="python make " -DEPS="libxml2 libgcrypt" - -PKG_VER=1.1.34 -SOURCE=http://xmlsoft.org/sources/libxslt-$PKG_VER.tar.gz -DESC="XML stylesheet transformation library" - - -prepare () { - sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.xml && - sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.1 && - sed -i -r '/max(Parser)?Depth/d' ./tests/fuzz/fuzz.c -} - -build () { - ./configure --prefix=/usr --disable-static --without-python && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/libxslt/libxslt.xibuild b/repo/system/libxslt/libxslt.xibuild new file mode 100644 index 0000000..805925f --- /dev/null +++ b/repo/system/libxslt/libxslt.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="python make " +DEPS="libxml2 libgcrypt" + +PKG_VER=1.1.34 +SOURCE=http://xmlsoft.org/sources/libxslt-$PKG_VER.tar.gz +DESC="XML stylesheet transformation library" + + +prepare () { + sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.xml && + sed -i s/3000/5000/ libxslt/transform.c doc/xsltproc.1 && + sed -i -r '/max(Parser)?Depth/d' ./tests/fuzz/fuzz.c +} + +build () { + ./configure --prefix=/usr --disable-static --without-python && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/ljx.xibuild b/repo/system/ljx.xibuild deleted file mode 100644 index c28cd7b..0000000 --- a/repo/system/ljx.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.3 -SOURCE=https://github.com/katlogic/ljx/archive/refs/tags/LJX-v$PKG_VER.tar.gz - -DESC="LuaJIT experimental 5.2/5.3 port" - - -build () { - make PREFIX=/usr - -} - -package () { - make install DESTDIR="$PKG_DEST" PREFIX=/usr -} diff --git a/repo/system/ljx/ljx.xibuild b/repo/system/ljx/ljx.xibuild new file mode 100644 index 0000000..c28cd7b --- /dev/null +++ b/repo/system/ljx/ljx.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.3 +SOURCE=https://github.com/katlogic/ljx/archive/refs/tags/LJX-v$PKG_VER.tar.gz + +DESC="LuaJIT experimental 5.2/5.3 port" + + +build () { + make PREFIX=/usr + +} + +package () { + make install DESTDIR="$PKG_DEST" PREFIX=/usr +} diff --git a/repo/system/lua-lpeg.xibuild b/repo/system/lua-lpeg.xibuild deleted file mode 100644 index f2b3b4d..0000000 --- a/repo/system/lua-lpeg.xibuild +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make tar patch lua lua5-1" -DEPS="musl" - -PKG_VER=1.0.2 -SOURCE=http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$PKG_VER.tar.gz -DESC="Pattern-matching library for Lua" -ADDITIONAL=" - build-static-lib.patch - test-fix-setlocale.patch -" - -luaversions="5.1 5.4" - -prepare () { - apply_patches - -# lver=$(lua -v | cut -d" " -f2 | cut -d. -f-2) - sed -i -e 's/^CFLAGS =/CFLAGS +=/' \ - -e 's/^COPT =/# COPT =/' \ - makefile - - for lver in $luaversions; do - tar xf lpeg-$PKG_VER.tar.gz - mv lpeg-$PKG_VER build-$lver - done -} - -build () { - for lver in $luaversions; do - echo building for $lver - make -C build-$lver LUADIR=/usr/include/lua$lver - done -} - -package () { - for lver in $luaversions; do - cd build-$lver - install -Dm755 lpeg.so \ - $PKG_DEST/usr/lib/lua/$lver/lpeg.so - install -Dm644 re.lua \ - $PKG_DEST/usr/share/lua/$lver/re.lua - - local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/lua-lpeg/$PKG_VER-1" - mkdir -p "$rockdir" - echo 'rock_manifest = {}' > "$rockdir"/rock_manifest - cd .. - done -} diff --git a/repo/system/lua-lpeg/build-static-lib.patch b/repo/system/lua-lpeg/build-static-lib.patch new file mode 100644 index 0000000..d8a8f8c --- /dev/null +++ b/repo/system/lua-lpeg/build-static-lib.patch @@ -0,0 +1,29 @@ +--- a/makefile ++++ b/makefile +@@ -24,12 +24,15 @@ + + CFLAGS = $(CWARNS) $(COPT) -std=c99 -I$(LUADIR) -fPIC + CC = gcc ++AR = ar ++RANLIB = ranlib + + FILES = lpvm.o lpcap.o lptree.o lpcode.o lpprint.o + + # For Linux + linux: + $(MAKE) lpeg.so "DLLFLAGS = -shared -fPIC" ++ $(MAKE) lpeg.a + + # For Mac OS + macosx: +@@ -37,6 +40,10 @@ + + lpeg.so: $(FILES) + env $(CC) $(DLLFLAGS) $(FILES) -o lpeg.so ++ ++lpeg.a: $(FILES) ++ env $(AR) rc lpeg.a $(FILES) ++ env $(RANLIB) lpeg.a + + $(FILES): makefile + diff --git a/repo/system/lua-lpeg/lua-lpeg.xibuild b/repo/system/lua-lpeg/lua-lpeg.xibuild new file mode 100644 index 0000000..f2b3b4d --- /dev/null +++ b/repo/system/lua-lpeg/lua-lpeg.xibuild @@ -0,0 +1,50 @@ +#!/bin/sh + +MAKEDEPS="make tar patch lua lua5-1" +DEPS="musl" + +PKG_VER=1.0.2 +SOURCE=http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$PKG_VER.tar.gz +DESC="Pattern-matching library for Lua" +ADDITIONAL=" + build-static-lib.patch + test-fix-setlocale.patch +" + +luaversions="5.1 5.4" + +prepare () { + apply_patches + +# lver=$(lua -v | cut -d" " -f2 | cut -d. -f-2) + sed -i -e 's/^CFLAGS =/CFLAGS +=/' \ + -e 's/^COPT =/# COPT =/' \ + makefile + + for lver in $luaversions; do + tar xf lpeg-$PKG_VER.tar.gz + mv lpeg-$PKG_VER build-$lver + done +} + +build () { + for lver in $luaversions; do + echo building for $lver + make -C build-$lver LUADIR=/usr/include/lua$lver + done +} + +package () { + for lver in $luaversions; do + cd build-$lver + install -Dm755 lpeg.so \ + $PKG_DEST/usr/lib/lua/$lver/lpeg.so + install -Dm644 re.lua \ + $PKG_DEST/usr/share/lua/$lver/re.lua + + local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/lua-lpeg/$PKG_VER-1" + mkdir -p "$rockdir" + echo 'rock_manifest = {}' > "$rockdir"/rock_manifest + cd .. + done +} diff --git a/repo/system/lua-lpeg/test-fix-setlocale.patch b/repo/system/lua-lpeg/test-fix-setlocale.patch new file mode 100644 index 0000000..028c18c --- /dev/null +++ b/repo/system/lua-lpeg/test-fix-setlocale.patch @@ -0,0 +1,20 @@ +os.setlocale just calls setlocale() from libc and musl's implementation +behaves a bit differently in comparison with BSD libc or glibc. + +When particular locales for all categories are the same, e.g. "C", +`setlocale(LC_ALL, "")` returns just "C" on BSD libc (tested on macOS) +and glibc, but musl returns "C;C;C;C;C;C". When some locale is different, +e.g. LC_CTYPE, then on macOS you get "C/en_US.UTF-8/C/C/C/C", on glibc +"LC_CTYPE=en_US.UTF-8;LC_NUMERIC=C;...", on musl "en_US.UTF-8;C;C;C;C;C". + +--- a/test.lua ++++ b/test.lua +@@ -1428,7 +1428,7 @@ + + + -- testing pre-defined names +-assert(os.setlocale("C") == "C") ++assert(os.setlocale("C"):sub(1, 1) == "C") + + function eqlpeggsub (p1, p2) + local s1 = cs2str(re.compile(p1)) diff --git a/repo/system/lua-mpack.xibuild b/repo/system/lua-mpack.xibuild deleted file mode 100644 index 85c5195..0000000 --- a/repo/system/lua-mpack.xibuild +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl libmpack" - -PKG_VER=1.0.9 -SOURCE=https://github.com/libmpack/libmpack-lua/archive/$PKG_VER.tar.gz -DESC="Libmpack bindings for Lua" -ADDITIONAL=" -dont-install-busted.patch -skip-memleak-test.patch -" - -luaversions="5.1 " - -prepare () { - apply_patches - - for lver in $luaversions; do - tar xf $PKG_VER.tar.gz - mv libmpack-lua-$PKG_VER build-$lver - done - -} - -build () { - for lver in $luaversions; do - echo "building for lua $lver" - make -C build-$lver \ - FETCH=false \ - USE_SYSTEM_LUA=yes \ - USE_SYSTEM_MPACK=yes \ - LUA=lua$lver \ - LUA_IMPL=lua$lver - #LUA_INCLUDE="$(pkg-config --cflags lua$lver)" \ - #LUA_LIB="$(pkg-config --libs lua$lver)" - done - -} - -package () { - for lver in $luaversions; do - echo "building for lua $lver" - local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/mpack/$PKG_VER-0" - - make -C build-$lver \ - USE_SYSTEM_LUA=yes \ - USE_SYSTEM_MPACK=yes \ - LUA_CMOD_INSTALLDIR="$(pkg-config --variable=INSTALL_CMOD lua$lver)" \ - DESTDIR="$subpkgdir" \ - install || exit 1 - - mkdir -p "$rockdir" - echo 'rock_manifest = {}' > "$rockdir"/rock_manifest - done -} diff --git a/repo/system/lua-mpack/dont-install-busted.patch b/repo/system/lua-mpack/dont-install-busted.patch new file mode 100644 index 0000000..2acb260 --- /dev/null +++ b/repo/system/lua-mpack/dont-install-busted.patch @@ -0,0 +1,13 @@ +Fix Makefile to not try to download and install LuaRocks and busted; use +system-provided busted. +--- a/Makefile ++++ b/Makefile +@@ -61,7 +61,7 @@ + depsclean: + rm -rf $(DEPS_DIR) + +-test: $(BUSTED) $(MPACK) ++test: $(MPACK) + $(BUSTED) -o gtest test.lua + + valgrind: $(BUSTED) $(MPACK) diff --git a/repo/system/lua-mpack/lua-mpack.xibuild b/repo/system/lua-mpack/lua-mpack.xibuild new file mode 100644 index 0000000..85c5195 --- /dev/null +++ b/repo/system/lua-mpack/lua-mpack.xibuild @@ -0,0 +1,56 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl libmpack" + +PKG_VER=1.0.9 +SOURCE=https://github.com/libmpack/libmpack-lua/archive/$PKG_VER.tar.gz +DESC="Libmpack bindings for Lua" +ADDITIONAL=" +dont-install-busted.patch +skip-memleak-test.patch +" + +luaversions="5.1 " + +prepare () { + apply_patches + + for lver in $luaversions; do + tar xf $PKG_VER.tar.gz + mv libmpack-lua-$PKG_VER build-$lver + done + +} + +build () { + for lver in $luaversions; do + echo "building for lua $lver" + make -C build-$lver \ + FETCH=false \ + USE_SYSTEM_LUA=yes \ + USE_SYSTEM_MPACK=yes \ + LUA=lua$lver \ + LUA_IMPL=lua$lver + #LUA_INCLUDE="$(pkg-config --cflags lua$lver)" \ + #LUA_LIB="$(pkg-config --libs lua$lver)" + done + +} + +package () { + for lver in $luaversions; do + echo "building for lua $lver" + local rockdir="$PKG_DEST/usr/lib/luarocks/rocks-$lver/mpack/$PKG_VER-0" + + make -C build-$lver \ + USE_SYSTEM_LUA=yes \ + USE_SYSTEM_MPACK=yes \ + LUA_CMOD_INSTALLDIR="$(pkg-config --variable=INSTALL_CMOD lua$lver)" \ + DESTDIR="$subpkgdir" \ + install || exit 1 + + mkdir -p "$rockdir" + echo 'rock_manifest = {}' > "$rockdir"/rock_manifest + done +} diff --git a/repo/system/lua-mpack/skip-memleak-test.patch b/repo/system/lua-mpack/skip-memleak-test.patch new file mode 100644 index 0000000..f89b522 --- /dev/null +++ b/repo/system/lua-mpack/skip-memleak-test.patch @@ -0,0 +1,20 @@ +This test requires binary to be built in debug mode. +--- a/test.lua ++++ b/test.lua +@@ -276,16 +276,6 @@ + end) + end) + +- it('should not leak memory', function() +- -- get the path to the lua interpreter, taken from +- -- http://stackoverflow.com/a/18304231 +- local i_min = 0 +- while arg[ i_min ] do i_min = i_min - 1 end +- i_min = i_min + 1 +- local res = io.popen(arg[i_min]..' leak_test.lua'):read('*a') +- assert.are_same('ok\n', res) +- end) +- + describe('is_bin option', function() + it('controls if strings are serialized to BIN or STR', function() + local isbin = false diff --git a/repo/system/lua.xibuild b/repo/system/lua.xibuild deleted file mode 100644 index fdcf8ab..0000000 --- a/repo/system/lua.xibuild +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="readline" - -PKG_VER=5.4.4 -SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz -ADDITIONAL=" - https://www.linuxfromscratch.org/patches/blfs/svn/lua-$PKG_VER-shared_library-1.patch - lua5.4.pc - " - -DESC="A powerful lightweight scripting language" - -prepare () { - sed -e "s|@MAJOR_VER@|${PKG_VER%.*}|g" \ - -e "s|@MINOR_VER@|${PKG_VER}|g" \ - -i lua5.4.pc - - patch -Np1 -i lua-$PKG_VER-shared_library-1.patch - cat > configure.ac <<-EOF - top_buildir=. - - AC_INIT(src/luaconf.h) - AC_PROG_LIBTOOL - AC_OUTPUT() - EOF - libtoolize --force --install && aclocal && autoconf - - -} - -build () { - ./configure \ - --prefix=/usr - cd src - CFLAGS="$CFLAGS -DLUA_USE_LINUX -DLUA_COMPAT_5_2" \ - SYSLDFLAGS="$LDFLAGS" \ - RPATH="/usr/lib" make -} - -package () { - cd .. - sed -i "s/INSTALL= install -p/INSTALL= install/g" Makefile - make V=${PKG_VER%.*} \ - INSTALL_TOP="$PKG_DEST"/usr \ - INSTALL_INC="$PKG_DEST"/usr/include/lua${PKG_VER%.*} \ - INSTALL_LIB="$PKG_DEST"/usr/lib/lua${PKG_VER%.*} install - - - mkdir -p $PKG_DEST/usr/share/doc/lua-$PKG_VER - for s in html css gif png; do - cp doc/*.$s $PKG_DEST/usr/share/doc/lua-$PKG_VER - done - install -Dm644 lua5.4.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.4.pc -} diff --git a/repo/system/lua/lua.xibuild b/repo/system/lua/lua.xibuild new file mode 100644 index 0000000..fdcf8ab --- /dev/null +++ b/repo/system/lua/lua.xibuild @@ -0,0 +1,56 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="readline" + +PKG_VER=5.4.4 +SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz +ADDITIONAL=" + https://www.linuxfromscratch.org/patches/blfs/svn/lua-$PKG_VER-shared_library-1.patch + lua5.4.pc + " + +DESC="A powerful lightweight scripting language" + +prepare () { + sed -e "s|@MAJOR_VER@|${PKG_VER%.*}|g" \ + -e "s|@MINOR_VER@|${PKG_VER}|g" \ + -i lua5.4.pc + + patch -Np1 -i lua-$PKG_VER-shared_library-1.patch + cat > configure.ac <<-EOF + top_buildir=. + + AC_INIT(src/luaconf.h) + AC_PROG_LIBTOOL + AC_OUTPUT() + EOF + libtoolize --force --install && aclocal && autoconf + + +} + +build () { + ./configure \ + --prefix=/usr + cd src + CFLAGS="$CFLAGS -DLUA_USE_LINUX -DLUA_COMPAT_5_2" \ + SYSLDFLAGS="$LDFLAGS" \ + RPATH="/usr/lib" make +} + +package () { + cd .. + sed -i "s/INSTALL= install -p/INSTALL= install/g" Makefile + make V=${PKG_VER%.*} \ + INSTALL_TOP="$PKG_DEST"/usr \ + INSTALL_INC="$PKG_DEST"/usr/include/lua${PKG_VER%.*} \ + INSTALL_LIB="$PKG_DEST"/usr/lib/lua${PKG_VER%.*} install + + + mkdir -p $PKG_DEST/usr/share/doc/lua-$PKG_VER + for s in html css gif png; do + cp doc/*.$s $PKG_DEST/usr/share/doc/lua-$PKG_VER + done + install -Dm644 lua5.4.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.4.pc +} diff --git a/repo/system/lua/lua5.4.pc b/repo/system/lua/lua5.4.pc new file mode 100644 index 0000000..06c8abc --- /dev/null +++ b/repo/system/lua/lua5.4.pc @@ -0,0 +1,24 @@ +# lua.pc -- pkg-config data for Lua + +# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' +prefix=/usr +INSTALL_BIN=${prefix}/bin +INSTALL_INC=${prefix}/include +INSTALL_LIB=${prefix}/lib +INSTALL_MAN=${prefix}/man/man1 +INSTALL_LMOD=${prefix}/share/lua/@MAJOR_VER@ +INSTALL_CMOD=${prefix}/lib/lua/@MAJOR_VER@ + +# canonical vars +exec_prefix=${prefix} +libdir=${exec_prefix}/lib/lua@MAJOR_VER@ +includedir=${prefix}/include/lua@MAJOR_VER@ + +Name: Lua +Description: An Extensible Extension Language +Version: @MINOR_VER@ +Requires: +Libs: -L${libdir} -llua -lm +Cflags: -I${includedir} + +# (end of lua@MAJOR_VER@.pc) diff --git a/repo/system/lua5-1.xibuild b/repo/system/lua5-1.xibuild deleted file mode 100644 index 5fc5f80..0000000 --- a/repo/system/lua5-1.xibuild +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="readline" - -PKG_VER=5.1.5 -SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz - -# use alpinelinux's makefile -ADDITIONAL=" - lua-5.1-make.patch - lua-5.1-module_paths.patch - lua-5.1-readline.patch -" - -DESC="A powerful lightweight scripting language" - -prepare () { - - apply_patches - - # we want packages to find our things - sed -i 's:/usr/local:/usr:' etc/lua.pc - - # correct lua versioning - sed -i 's/\(LIB_VERSION = \).*/\16:4:1/' src/Makefile - - cat > configure.ac <<-EOF - top_buildir=. - - AC_INIT(src/luaconf.h) - AC_PROG_LIBTOOL - AC_OUTPUT() - EOF - libtoolize --force --install && aclocal && autoconf - - -} - -build () { - ./configure \ - --prefix=/usr - cd src - make CFLAGS="$CFLAGS -DLUA_USE_LINUX" \ - SYSLDFLAGS="$LDFLAGS" \ - LIB_LIBS="-lpthread -lm -ldl" \ - RPATH="/usr/lib" \ - V=${PKG_VER%.*} alpine_all -} - -package () { - cd .. - sed -i "s/INSTALL= install -p/INSTALL= install/g" Makefile - make V=$PKG_VER \ - INSTALL_TOP="$PKG_DEST/usr" \ - INSTALL_INC="$PKG_DEST/usr/include" \ - INSTALL_LIB="$PKG_DEST/usr/lib" \ - alpine_install - - install -D -m 644 etc/lua.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.1.pc - install -D -m 644 doc/lua.1 "$PKG_DEST"/usr/share/man/man1/lua5.1.1 - install -D -m 644 doc/luac.1 "$PKG_DEST"/usr/share/man/man1/luac5.1.1 - - mkdir -p "$PKG_DEST"/usr/share/doc/lua5-1/ - install -m644 doc/*.html doc/*.css doc/logo.gif doc/cover.png \ - "$PKG_DEST"/usr/share/doc/lua5-1/ - - # Create symlinks without version suffix. - ln -s lua5.1 "$PKG_DEST"/usr/bin/lua - ln -s luac5.1 "$PKG_DEST"/usr/bin/luac - ln -s lua5.1.pc "$PKG_DEST"/usr/lib/pkgconfig/lua.pc - ln -s lua5.1.1 "$PKG_DEST"/usr/share/man/man1/lua.1 - ln -s luac5.1.1 "$PKG_DEST"/usr/share/man/man1/luac.1 - - - install -m644 -D etc/lua.pc $PKG_DEST/usr/lib/pkgconfig/lua5.1.pc -} diff --git a/repo/system/lua5-1/lua-5.1-make.patch b/repo/system/lua5-1/lua-5.1-make.patch new file mode 100644 index 0000000..2db6367 --- /dev/null +++ b/repo/system/lua5-1/lua-5.1-make.patch @@ -0,0 +1,71 @@ +--- ./Makefile.orig ++++ ./Makefile +@@ -126,3 +126,18 @@ + .PHONY: all $(PLATS) clean test install local none dummy echo pecho lecho + + # (end of Makefile) ++ ++# Use libtool for binary installs, etc. ++ ++export V ++export LIBTOOL = ../libtool --quiet --tag=CC ++# See libtool manual about how to set this ++ ++alpine_clean: ++ cd src; $(MAKE) $@ ++ ++alpine_install: ++ mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua luac $(INSTALL_BIN) ++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) ++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua.la $(INSTALL_LIB) +--- ./src/Makefile.orig ++++ ./src/Makefile +@@ -51,10 +51,10 @@ + $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files + $(RANLIB) $@ + +-$(LUA_T): $(LUA_O) $(LUA_A) ++origin$(LUA_T): $(LUA_O) $(LUA_A) + $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) + +-$(LUAC_T): $(LUAC_O) $(LUA_A) ++origin$(LUAC_T): $(LUAC_O) $(LUA_A) + $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) + + clean: +@@ -178,5 +178,34 @@ + lzio.h + print.o: print.c ldebug.h lstate.h lua.h luaconf.h lobject.h llimits.h \ + ltm.h lzio.h lmem.h lopcodes.h lundump.h ++ ++ ++export LIBTOOL = ../libtool --quiet --tag=CC ++export LIB_VERSION = 0:0:0 ++ ++# The following rules use libtool for compiling and linking in order to ++# provide shared library support. ++ ++LIB_NAME = liblua.la ++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo) ++ ++%.lo %.o: %.c ++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< ++ ++$(LIB_NAME): $(LIB_OBJS) ++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \ ++ -rpath $(RPATH) $(LDFLAGS) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS) ++ ++$(LUA_T): $(LUA_O:.o=.lo) $(LIB_NAME) ++ $(LIBTOOL) --mode=link $(CC) -export-dynamic $(LDFLAGS) -o $@ $(LUA_O:.o=.lo) $(LIB_NAME) $(LUA_LIBS) ++ ++$(LUAC_T): $(LUAC_O:.o=.lo) $(LIB_NAME) ++ $(LIBTOOL) --mode=link $(CC) -static $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(LIB_NAME) ++ ++alpine_clean: ++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua luac ++ ++alpine_all: $(LIB_NAME) $(LUA_T) $(LUAC_T) ++ + + # (end of Makefile) diff --git a/repo/system/lua5-1/lua-5.1-module_paths.patch b/repo/system/lua5-1/lua-5.1-module_paths.patch new file mode 100644 index 0000000..e67d09f --- /dev/null +++ b/repo/system/lua5-1/lua-5.1-module_paths.patch @@ -0,0 +1,24 @@ +--- a/src/luaconf.h ++++ b/src/luaconf.h +@@ -95,13 +94,19 @@ + + #else + #define LUA_ROOT "/usr/local/" ++#define LUA_ROOT2 "/usr/" + #define LUA_LDIR LUA_ROOT "share/lua/5.1/" ++#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/" ++#define LUA_LDIR3 LUA_ROOT2 "share/lua/common/" + #define LUA_CDIR LUA_ROOT "lib/lua/5.1/" ++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/5.1/" + #define LUA_PATH_DEFAULT \ + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ +- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" ++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \ ++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua;" \ ++ LUA_LDIR3"?.lua;" LUA_LDIR3"?/init.lua" + #define LUA_CPATH_DEFAULT \ +- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so" ++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so" + #endif + + diff --git a/repo/system/lua5-1/lua-5.1-readline.patch b/repo/system/lua5-1/lua-5.1-readline.patch new file mode 100644 index 0000000..f144861 --- /dev/null +++ b/repo/system/lua5-1/lua-5.1-readline.patch @@ -0,0 +1,10 @@ +--- lua-5.1.1.orig/src/luaconf.h 2006-04-10 20:27:23.000000000 +0200 ++++ lua-5.1.1/src/luaconf.h 2006-11-15 14:53:07.000000000 +0100 +@@ -36,7 +36,6 @@ + #if defined(LUA_USE_LINUX) + #define LUA_USE_POSIX + #define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +-#define LUA_USE_READLINE /* needs some extra libraries */ + #endif + + #if defined(LUA_USE_MACOSX) diff --git a/repo/system/lua5-1/lua.pc b/repo/system/lua5-1/lua.pc new file mode 100644 index 0000000..1e78955 --- /dev/null +++ b/repo/system/lua5-1/lua.pc @@ -0,0 +1,32 @@ +# lua.pc -- pkg-config data for Lua + +# vars from install Makefile + +# grep '^V=' ../Makefile +V= 5.1 +# grep '^R=' ../Makefile +R= 5.1.5 + +# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/' +prefix= /usr +INSTALL_BIN= ${prefix}/bin +INSTALL_INC= ${prefix}/include +INSTALL_LIB= ${prefix}/lib +INSTALL_MAN= ${prefix}/man/man1 +INSTALL_LMOD= ${prefix}/share/lua/${V} +INSTALL_CMOD= ${prefix}/lib/lua/${V} + +# canonical vars +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Lua +Description: An Extensible Extension Language +Version: ${R} +Requires: +Libs: -L${libdir} -llua -lm +Cflags: -I${includedir} + +# (end of lua.pc) + diff --git a/repo/system/lua5-1/lua5-1.xibuild b/repo/system/lua5-1/lua5-1.xibuild new file mode 100644 index 0000000..5fc5f80 --- /dev/null +++ b/repo/system/lua5-1/lua5-1.xibuild @@ -0,0 +1,77 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="readline" + +PKG_VER=5.1.5 +SOURCE=https://www.lua.org/ftp/lua-$PKG_VER.tar.gz + +# use alpinelinux's makefile +ADDITIONAL=" + lua-5.1-make.patch + lua-5.1-module_paths.patch + lua-5.1-readline.patch +" + +DESC="A powerful lightweight scripting language" + +prepare () { + + apply_patches + + # we want packages to find our things + sed -i 's:/usr/local:/usr:' etc/lua.pc + + # correct lua versioning + sed -i 's/\(LIB_VERSION = \).*/\16:4:1/' src/Makefile + + cat > configure.ac <<-EOF + top_buildir=. + + AC_INIT(src/luaconf.h) + AC_PROG_LIBTOOL + AC_OUTPUT() + EOF + libtoolize --force --install && aclocal && autoconf + + +} + +build () { + ./configure \ + --prefix=/usr + cd src + make CFLAGS="$CFLAGS -DLUA_USE_LINUX" \ + SYSLDFLAGS="$LDFLAGS" \ + LIB_LIBS="-lpthread -lm -ldl" \ + RPATH="/usr/lib" \ + V=${PKG_VER%.*} alpine_all +} + +package () { + cd .. + sed -i "s/INSTALL= install -p/INSTALL= install/g" Makefile + make V=$PKG_VER \ + INSTALL_TOP="$PKG_DEST/usr" \ + INSTALL_INC="$PKG_DEST/usr/include" \ + INSTALL_LIB="$PKG_DEST/usr/lib" \ + alpine_install + + install -D -m 644 etc/lua.pc "$PKG_DEST"/usr/lib/pkgconfig/lua5.1.pc + install -D -m 644 doc/lua.1 "$PKG_DEST"/usr/share/man/man1/lua5.1.1 + install -D -m 644 doc/luac.1 "$PKG_DEST"/usr/share/man/man1/luac5.1.1 + + mkdir -p "$PKG_DEST"/usr/share/doc/lua5-1/ + install -m644 doc/*.html doc/*.css doc/logo.gif doc/cover.png \ + "$PKG_DEST"/usr/share/doc/lua5-1/ + + # Create symlinks without version suffix. + ln -s lua5.1 "$PKG_DEST"/usr/bin/lua + ln -s luac5.1 "$PKG_DEST"/usr/bin/luac + ln -s lua5.1.pc "$PKG_DEST"/usr/lib/pkgconfig/lua.pc + ln -s lua5.1.1 "$PKG_DEST"/usr/share/man/man1/lua.1 + ln -s luac5.1.1 "$PKG_DEST"/usr/share/man/man1/luac.1 + + + install -m644 -D etc/lua.pc $PKG_DEST/usr/lib/pkgconfig/lua5.1.pc +} diff --git a/repo/system/luajit.xibuild b/repo/system/luajit.xibuild deleted file mode 100644 index 09f6015..0000000 --- a/repo/system/luajit.xibuild +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl lua5-1" - -PKG_VER=2.1 -SUBVER=20220310 -SOURCE=https://github.com/openresty/luajit2/archive/refs/tags/v$PKG_VER-$SUBVER.tar.gz -ADDITIONAL=" -module-paths.patch -" - -DESC="OpenResty's branch of LuaJIT" - -prepare () { - apply_patches -} - -build () { - local xcflags="-DLUAJIT_ENABLE_LUA52COMPAT -DLUAJIT_NUMMODE=2" - [ "$CARCH" = x86_64 ] && xcflags="$xcflags -msse4.2" - make amalg PREFIX=/usr XCFLAGS="$xcflags" - -} - -package () { - make install DESTDIR="$PKG_DEST" PREFIX=/usr - - install -Dm644 COPYRIGHT \ - $PKG_DEST/usr/share/licenses/luajit/COPYRIGHT - -} diff --git a/repo/system/luajit/luajit.xibuild b/repo/system/luajit/luajit.xibuild new file mode 100644 index 0000000..09f6015 --- /dev/null +++ b/repo/system/luajit/luajit.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl lua5-1" + +PKG_VER=2.1 +SUBVER=20220310 +SOURCE=https://github.com/openresty/luajit2/archive/refs/tags/v$PKG_VER-$SUBVER.tar.gz +ADDITIONAL=" +module-paths.patch +" + +DESC="OpenResty's branch of LuaJIT" + +prepare () { + apply_patches +} + +build () { + local xcflags="-DLUAJIT_ENABLE_LUA52COMPAT -DLUAJIT_NUMMODE=2" + [ "$CARCH" = x86_64 ] && xcflags="$xcflags -msse4.2" + make amalg PREFIX=/usr XCFLAGS="$xcflags" + +} + +package () { + make install DESTDIR="$PKG_DEST" PREFIX=/usr + + install -Dm644 COPYRIGHT \ + $PKG_DEST/usr/share/licenses/luajit/COPYRIGHT + +} diff --git a/repo/system/luajit/module-paths.patch b/repo/system/luajit/module-paths.patch new file mode 100644 index 0000000..46e8d12 --- /dev/null +++ b/repo/system/luajit/module-paths.patch @@ -0,0 +1,25 @@ +Add /usr/share/lua/common to LUA_PATH. We use this directory for Lua modules +that are compatible with Lua 5.1 and newer. + +--- a/src/luaconf.h ++++ b/src/luaconf.h +@@ -42,8 +42,10 @@ + #ifdef LUA_ROOT + #define LUA_JROOT LUA_ROOT + #define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR ++#define LUA_RLDIR2 LUA_ROOT "/share/lua/common/" + #define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR + #define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua" ++#define LUA_RLPATH2 ";" LUA_RLDIR2 "?.lua;" LUA_RLDIR2 "?/init.lua" + #define LUA_RCPATH ";" LUA_RCDIR "?.so" + #else + #define LUA_JROOT LUA_LROOT +@@ -58,7 +60,7 @@ + #define LUA_LCPATH1 ";" LUA_LCDIR "?.so" + #define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so" + +-#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH ++#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH LUA_RLPATH2 + #define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2 + #endif + diff --git a/repo/system/lz4.xibuild b/repo/system/lz4.xibuild deleted file mode 100644 index e0bfd68..0000000 --- a/repo/system/lz4.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="sh" - -PKG_VER=1.9.3 -SOURCE=https://github.com/lz4/lz4/archive/refs/tags/v$PKG_VER.tar.gz -DESC="A lossless compression algorithm, providing high compression speeds" - - -build () { - make -C lib PREFIX=/usr - make -C programs PREFIX=/usr lz4 lz4c -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install -} - diff --git a/repo/system/lz4/lz4.xibuild b/repo/system/lz4/lz4.xibuild new file mode 100644 index 0000000..e0bfd68 --- /dev/null +++ b/repo/system/lz4/lz4.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="sh" + +PKG_VER=1.9.3 +SOURCE=https://github.com/lz4/lz4/archive/refs/tags/v$PKG_VER.tar.gz +DESC="A lossless compression algorithm, providing high compression speeds" + + +build () { + make -C lib PREFIX=/usr + make -C programs PREFIX=/usr lz4 lz4c +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install +} + diff --git a/repo/system/lzo.xibuild b/repo/system/lzo.xibuild deleted file mode 100644 index 4c24afc..0000000 --- a/repo/system/lzo.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.10 -SOURCE=https://www.oberhumer.com/opensource/lzo/download/lzo-$PKG_VER.tar.gz - -DESC="Portable lossless data compression library" - -build () { - ./configure --prefix=/usr --disable-static --enable-shared --docdir=/usr/share/doc/lzo-$PKG_VER - make -} - -package() { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/lzo/lzo.xibuild b/repo/system/lzo/lzo.xibuild new file mode 100644 index 0000000..4c24afc --- /dev/null +++ b/repo/system/lzo/lzo.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.10 +SOURCE=https://www.oberhumer.com/opensource/lzo/download/lzo-$PKG_VER.tar.gz + +DESC="Portable lossless data compression library" + +build () { + ./configure --prefix=/usr --disable-static --enable-shared --docdir=/usr/share/doc/lzo-$PKG_VER + make +} + +package() { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/menu-cache.xibuild b/repo/system/menu-cache.xibuild deleted file mode 100644 index 6183364..0000000 --- a/repo/system/menu-cache.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -NAME="menu-cache" -DESC="Caching mechanism for freedesktop.org compliant menus" - -MAKEDEPS="make libfm-extra" -DEPS="glib " - -PKG_VER=1.1.0 -SOURCE="https://downloads.sourceforge.net/lxde/menu-cache-$PKG_VER.tar.xz" -ADDITIONAL="menu-cache-1.1.0-0001-Support-gcc10-compilation.patch " - -prepare () { - apply_patches -} - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/menu-cache/menu-cache-1.1.0-0001-Support-gcc10-compilation.patch b/repo/system/menu-cache/menu-cache-1.1.0-0001-Support-gcc10-compilation.patch new file mode 100644 index 0000000..29f8e53 --- /dev/null +++ b/repo/system/menu-cache/menu-cache-1.1.0-0001-Support-gcc10-compilation.patch @@ -0,0 +1,108 @@ +From 1ce739649b4d66339a03fc0ec9ee7a2f7c141780 Mon Sep 17 00:00:00 2001 +From: Mamoru TASAKA +Date: Fri, 24 Jan 2020 13:33:00 +0900 +Subject: [PATCH] Support gcc10 compilation + +gcc10 now defaults to -fno-common, and with gcc10 menu-cache compilation fails like + +/bin/ld: menu-merge.o:menu-cache-gen/menu-tags.h:167: multiple definition of `DirDirs'; main.o:menu-cache-gen/menu-tags.h:167: first defined here +/bin/ld: menu-merge.o:menu-cache-gen/menu-tags.h:164: multiple definition of `AppDirs'; main.o:menu-cache-gen/menu-tags.h:164: first defined here +/bin/ld: menu-merge.o:menu-cache-gen/menu-tags.h:52: multiple definition of `menuTag_Layout'; main.o:menu-cache-gen/menu-tags.h:52: first defined here +.... + +This patch fixes compilation with gcc10: properly declaring variables in header with "extern", and also removing some unneeded variables in header files. +--- + menu-cache-gen/menu-tags.h | 55 ++++++++++++-------------------------- + 1 file changed, 17 insertions(+), 38 deletions(-) + +diff --git a/menu-cache-gen/menu-tags.h b/menu-cache-gen/menu-tags.h +index f3fd7d3..f71c0bc 100644 +--- a/menu-cache-gen/menu-tags.h ++++ b/menu-cache-gen/menu-tags.h +@@ -22,38 +22,17 @@ + #include + #include + +-FmXmlFileTag menuTag_Menu; +-FmXmlFileTag menuTag_AppDir; +-FmXmlFileTag menuTag_DefaultAppDirs; +-FmXmlFileTag menuTag_DirectoryDir; +-FmXmlFileTag menuTag_DefaultDirectoryDirs; +-FmXmlFileTag menuTag_Include; +-FmXmlFileTag menuTag_Exclude; +-FmXmlFileTag menuTag_Filename; +-FmXmlFileTag menuTag_Or; +-FmXmlFileTag menuTag_And; +-FmXmlFileTag menuTag_Not; +-FmXmlFileTag menuTag_Category; +-FmXmlFileTag menuTag_MergeFile; +-FmXmlFileTag menuTag_MergeDir; +-FmXmlFileTag menuTag_DefaultMergeDirs; +-FmXmlFileTag menuTag_Directory; +-FmXmlFileTag menuTag_Name; +-FmXmlFileTag menuTag_Deleted; +-FmXmlFileTag menuTag_NotDeleted; +-FmXmlFileTag menuTag_OnlyUnallocated; +-FmXmlFileTag menuTag_NotOnlyUnallocated; +-FmXmlFileTag menuTag_All; +-FmXmlFileTag menuTag_LegacyDir; +-FmXmlFileTag menuTag_KDELegacyDirs; +-FmXmlFileTag menuTag_Move; +-FmXmlFileTag menuTag_Old; +-FmXmlFileTag menuTag_New; +-FmXmlFileTag menuTag_Layout; +-FmXmlFileTag menuTag_DefaultLayout; +-FmXmlFileTag menuTag_Menuname; +-FmXmlFileTag menuTag_Separator; +-FmXmlFileTag menuTag_Merge; ++extern FmXmlFileTag menuTag_AppDir; ++extern FmXmlFileTag menuTag_DirectoryDir; ++extern FmXmlFileTag menuTag_Include; ++extern FmXmlFileTag menuTag_Exclude; ++extern FmXmlFileTag menuTag_Filename; ++extern FmXmlFileTag menuTag_Or; ++extern FmXmlFileTag menuTag_And; ++extern FmXmlFileTag menuTag_Not; ++extern FmXmlFileTag menuTag_Category; ++extern FmXmlFileTag menuTag_All; ++extern FmXmlFileTag menuTag_LegacyDir; + + typedef enum { + MERGE_NONE, /* starting value */ +@@ -152,19 +131,19 @@ typedef struct { + } MenuRule; + + /* requested language(s) */ +-char **languages; ++extern char **languages; + + /* list of menu files to monitor */ +-GSList *MenuFiles; ++extern GSList *MenuFiles; + + /* list of menu dirs to monitor */ +-GSList *MenuDirs; ++extern GSList *MenuDirs; + + /* list of available app dirs */ +-GSList *AppDirs; ++extern GSList *AppDirs; + + /* list of available dir dirs */ +-GSList *DirDirs; ++extern GSList *DirDirs; + + /* parse and merge menu files */ + MenuMenu *get_merged_menu(const char *file, FmXmlFile **xmlfile, GError **error); +@@ -177,7 +156,7 @@ gboolean save_menu_cache(MenuMenu *layout, const char *menuname, const char *fil + void _free_layout_items(GList *data); + + /* verbosity level */ +-gint verbose; ++extern gint verbose; + + #define DBG if (verbose) g_debug + #define VDBG if (verbose > 1) g_debug +-- +2.24.1 + diff --git a/repo/system/menu-cache/menu-cache.xibuild b/repo/system/menu-cache/menu-cache.xibuild new file mode 100644 index 0000000..6183364 --- /dev/null +++ b/repo/system/menu-cache/menu-cache.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +NAME="menu-cache" +DESC="Caching mechanism for freedesktop.org compliant menus" + +MAKEDEPS="make libfm-extra" +DEPS="glib " + +PKG_VER=1.1.0 +SOURCE="https://downloads.sourceforge.net/lxde/menu-cache-$PKG_VER.tar.xz" +ADDITIONAL="menu-cache-1.1.0-0001-Support-gcc10-compilation.patch " + +prepare () { + apply_patches +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/mobile-broadband-provider-info.xibuild b/repo/system/mobile-broadband-provider-info.xibuild deleted file mode 100644 index 618feb3..0000000 --- a/repo/system/mobile-broadband-provider-info.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="autoconf automake libxml2 libxslt" -DEPS="pkgconf" - -PKG_VER=20201225 -SOURCE=https://download.gnome.org/sources/mobile-broadband-provider-info/$PKG_VER/mobile-broadband-provider-info-$PKG_VER.tar.xz -DESC="Mobile broadband settings for various service providers" - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - diff --git a/repo/system/mobile-broadband-provider-info/mobile-broadband-provider-info.xibuild b/repo/system/mobile-broadband-provider-info/mobile-broadband-provider-info.xibuild new file mode 100644 index 0000000..618feb3 --- /dev/null +++ b/repo/system/mobile-broadband-provider-info/mobile-broadband-provider-info.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="autoconf automake libxml2 libxslt" +DEPS="pkgconf" + +PKG_VER=20201225 +SOURCE=https://download.gnome.org/sources/mobile-broadband-provider-info/$PKG_VER/mobile-broadband-provider-info-$PKG_VER.tar.xz +DESC="Mobile broadband settings for various service providers" + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + diff --git a/repo/system/modemmanager.xibuild b/repo/system/modemmanager.xibuild deleted file mode 100644 index b2d5c5d..0000000 --- a/repo/system/modemmanager.xibuild +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh - -MAKEDEPS="gobject-introspection gtk-doc vala libgudev polkit libmbim libqmi linux-headers" -DEPS="dbus musl glib polkit" - -PKG_VER=1.18.6 -SOURCE=https://www.freedesktop.org/software/ModemManager/ModemManager-$PKG_VER.tar.xz - -ADDITIONAL=" -modemmanager.initd -modemmanager.rules -" - -DESC="ModemManager library" - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --localstatedir=/var \ - --with-polkit=permissive \ - --enable-plugin-qcom-soc \ - --enable-gtk-doc \ - --disable-static \ - --enable-vala=yes \ - --with-systemd-suspend-resume=yes - make - - - -} - -package () { - make DESTDIR="$PKG_DEST" install - rm -rf "$PKG_DEST"/usr/share/dbus-1/system-services #systemd-service - mkdir -p "$PKG_DEST/usr/share/polkit-1/rules.d" - install -m644 -D "modemmanager.rules" \ - "$PKG_DEST/usr/share/polkit-1/rules.d/01-org.freedesktop.ModemManager.rules" - install -m755 -D "modemmanager.initd" \ - "$PKG_DEST/etc/init.d/modemmanager" - mkdir -p "$PKG_DEST/usr/share/doc/modemmanager" - cat > $PKG_DEST/usr/share/doc/modemmanager/README < + + +modemmanager.rules « modemmanager « community - aports - Alpine packages build scripts + + + + + + + + + +
+ + + + +
+aboutsummaryrefslogtreecommitdiffstats
+ + + +
+
+
blob: 4c56fb7f9ef117068e03d8e6c01d2f51dad066bd (plain) (blame) + + +
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+
// Let users in plugdev group modify ModemManager
+polkit.addRule(function(action, subject) {
+    if ((action.id == "org.freedesktop.ModemManager1.Device.Control" ||
+	action.id == "org.freedesktop.ModemManager1.Contacts" ||
+	action.id == "org.freedesktop.ModemManager1.Messaging" ||
+	action.id == "org.freedesktop.ModemManager1.Location") &&
+        subject.isInGroup("plugdev") && subject.active) {
+        return "yes";
+    }
+});
+
+// Let geoclue modify ModemManager for location gathering
+polkit.addRule(function(action, subject) {
+    if ((action.id == "org.freedesktop.ModemManager1.Device.Control" ||
+	action.id == "org.freedesktop.ModemManager1.Location") &&
+        subject.isInGroup("geoclue")) {
+        return "yes";
+    }
+});
+
+
+ +
+ + diff --git a/repo/system/modemmanager/modemmanager.xibuild b/repo/system/modemmanager/modemmanager.xibuild new file mode 100644 index 0000000..b2d5c5d --- /dev/null +++ b/repo/system/modemmanager/modemmanager.xibuild @@ -0,0 +1,50 @@ +#!/bin/sh + +MAKEDEPS="gobject-introspection gtk-doc vala libgudev polkit libmbim libqmi linux-headers" +DEPS="dbus musl glib polkit" + +PKG_VER=1.18.6 +SOURCE=https://www.freedesktop.org/software/ModemManager/ModemManager-$PKG_VER.tar.xz + +ADDITIONAL=" +modemmanager.initd +modemmanager.rules +" + +DESC="ModemManager library" + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --localstatedir=/var \ + --with-polkit=permissive \ + --enable-plugin-qcom-soc \ + --enable-gtk-doc \ + --disable-static \ + --enable-vala=yes \ + --with-systemd-suspend-resume=yes + make + + + +} + +package () { + make DESTDIR="$PKG_DEST" install + rm -rf "$PKG_DEST"/usr/share/dbus-1/system-services #systemd-service + mkdir -p "$PKG_DEST/usr/share/polkit-1/rules.d" + install -m644 -D "modemmanager.rules" \ + "$PKG_DEST/usr/share/polkit-1/rules.d/01-org.freedesktop.ModemManager.rules" + install -m755 -D "modemmanager.initd" \ + "$PKG_DEST/etc/init.d/modemmanager" + mkdir -p "$PKG_DEST/usr/share/doc/modemmanager" + cat > $PKG_DEST/usr/share/doc/modemmanager/README < $PKG_DEST/etc/ld-musl-x86_64.path << "EOF" -/lib -/usr/local/lib -/usr/lib -EOF - - rm $PKG_DEST/usr/include/utmpx.h -} - diff --git a/repo/system/musl/0001-riscv64-define-ELF_NFPREG.patch b/repo/system/musl/0001-riscv64-define-ELF_NFPREG.patch new file mode 100644 index 0000000..b2f0a0f --- /dev/null +++ b/repo/system/musl/0001-riscv64-define-ELF_NFPREG.patch @@ -0,0 +1,24 @@ +From e5d2823631bbfebacf48e1a34ed28f28d7cb2570 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Mon, 11 Jan 2021 09:40:33 -0800 +Subject: [PATCH] riscv64: define ELF_NFPREG + +ELF_NFPREG is used by some userspace applications like gdb +--- + arch/riscv64/bits/user.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/riscv64/bits/user.h b/arch/riscv64/bits/user.h +index 2da743ea..0d37de0b 100644 +--- a/arch/riscv64/bits/user.h ++++ b/arch/riscv64/bits/user.h +@@ -1,5 +1,6 @@ + #include + + #define ELF_NGREG 32 ++#define ELF_NFPREG 33 + typedef unsigned long elf_greg_t, elf_gregset_t[ELF_NGREG]; + typedef union __riscv_mc_fp_state elf_fpregset_t; +-- +2.30.1 + diff --git a/repo/system/musl/change-scheduler-functions-Linux-compatib.patch b/repo/system/musl/change-scheduler-functions-Linux-compatib.patch new file mode 100644 index 0000000..fb63dfd --- /dev/null +++ b/repo/system/musl/change-scheduler-functions-Linux-compatib.patch @@ -0,0 +1,52 @@ +diff -uNr musl-1.2.2.orig/src/sched/sched_getparam.c musl-1.2.2/src/sched/sched_getparam.c +--- musl-1.2.2.orig/src/sched/sched_getparam.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_getparam.c 2021-12-23 00:31:16.590518270 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_getparam(pid_t pid, struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_getparam, pid, param); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_getscheduler.c musl-1.2.2/src/sched/sched_getscheduler.c +--- musl-1.2.2.orig/src/sched/sched_getscheduler.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_getscheduler.c 2021-12-23 00:33:32.949520644 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_getscheduler(pid_t pid) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_getscheduler, pid); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_setparam.c musl-1.2.2/src/sched/sched_setparam.c +--- musl-1.2.2.orig/src/sched/sched_setparam.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_setparam.c 2021-12-23 00:35:12.277522374 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_setparam(pid_t pid, const struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_setparam, pid, param); + } +diff -uNr musl-1.2.2.orig/src/sched/sched_setscheduler.c musl-1.2.2/src/sched/sched_setscheduler.c +--- musl-1.2.2.orig/src/sched/sched_setscheduler.c 2021-01-15 02:26:00.000000000 +0000 ++++ musl-1.2.2/src/sched/sched_setscheduler.c 2021-12-23 00:36:37.548523859 +0000 +@@ -1,8 +1,7 @@ + #include +-#include + #include "syscall.h" + + int sched_setscheduler(pid_t pid, int sched, const struct sched_param *param) + { +- return __syscall_ret(-ENOSYS); ++ return syscall(SYS_sched_setscheduler, pid, sched, param); + } diff --git a/repo/system/musl/fix-utmp-wtmp-paths.patch b/repo/system/musl/fix-utmp-wtmp-paths.patch new file mode 100644 index 0000000..900abc7 --- /dev/null +++ b/repo/system/musl/fix-utmp-wtmp-paths.patch @@ -0,0 +1,29 @@ +diff -uNr musl-1.2.2.orig/include/paths.h musl-1.2.2/include/paths.h +--- musl-1.2.2.orig/include/paths.h 2021-01-14 20:26:00.000000000 -0600 ++++ musl-1.2.2/include/paths.h 2021-08-26 16:39:31.355618388 -0500 +@@ -18,9 +18,9 @@ + #define _PATH_SHADOW "/etc/shadow" + #define _PATH_SHELLS "/etc/shells" + #define _PATH_TTY "/dev/tty" +-#define _PATH_UTMP "/dev/null/utmp" ++#define _PATH_UTMP "/run/utmps/utmp" + #define _PATH_VI "/usr/bin/vi" +-#define _PATH_WTMP "/dev/null/wtmp" ++#define _PATH_WTMP "/var/log/wtmp" + + #define _PATH_DEV "/dev/" + #define _PATH_TMP "/tmp/" +diff -uNr musl-1.2.2.orig/include/utmp.h musl-1.2.2/include/utmp.h +--- musl-1.2.2.orig/include/utmp.h 2021-01-14 20:26:00.000000000 -0600 ++++ musl-1.2.2/include/utmp.h 2021-08-26 16:37:11.567365982 -0500 +@@ -37,8 +37,8 @@ + + int login_tty(int); + +-#define _PATH_UTMP "/dev/null/utmp" +-#define _PATH_WTMP "/dev/null/wtmp" ++#define _PATH_UTMP "/run/utmps/utmp" ++#define _PATH_WTMP "/var/log/wtmp" + + #define UTMP_FILE _PATH_UTMP + #define WTMP_FILE _PATH_WTMP diff --git a/repo/system/musl/handle-aux-at_base.patch b/repo/system/musl/handle-aux-at_base.patch new file mode 100644 index 0000000..7c9f2dc --- /dev/null +++ b/repo/system/musl/handle-aux-at_base.patch @@ -0,0 +1,46 @@ +This is required to make the gcompat ELF interpreter stub work with some +packed binaries. + +diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c +index b125eb1..616c6a6 100644 +--- a/src/env/__init_tls.c ++++ b/src/env/__init_tls.c +@@ -66,8 +66,10 @@ void *__copy_tls(unsigned char *mem) + } + + #if ULONG_MAX == 0xffffffff ++typedef Elf32_Ehdr Ehdr; + typedef Elf32_Phdr Phdr; + #else ++typedef Elf64_Ehdr Ehdr; + typedef Elf64_Phdr Phdr; + #endif + +@@ -77,15 +79,23 @@ extern const size_t _DYNAMIC[]; + static void static_init_tls(size_t *aux) + { + unsigned char *p; +- size_t n; ++ size_t n, e; + Phdr *phdr, *tls_phdr=0; + size_t base = 0; + void *mem; + +- for (p=(void *)aux[AT_PHDR],n=aux[AT_PHNUM]; n; n--,p+=aux[AT_PHENT]) { ++ if (aux[AT_BASE]) { ++ Ehdr *ehdr = (void *)aux[AT_BASE]; ++ p = (unsigned char *)aux[AT_BASE] + ehdr->e_phoff; ++ n = ehdr->e_phnum; ++ e = ehdr->e_phentsize; ++ } else { ++ p = (void *)aux[AT_PHDR]; ++ n = aux[AT_PHNUM]; ++ e = aux[AT_PHENT]; ++ } ++ for (; n; n--, p+=e) { + phdr = (void *)p; +- if (phdr->p_type == PT_PHDR) +- base = aux[AT_PHDR] - phdr->p_vaddr; + if (phdr->p_type == PT_DYNAMIC && _DYNAMIC) + base = (size_t)_DYNAMIC - phdr->p_vaddr; + if (phdr->p_type == PT_TLS) diff --git a/repo/system/musl/musl.xibuild b/repo/system/musl/musl.xibuild new file mode 100644 index 0000000..6f15382 --- /dev/null +++ b/repo/system/musl/musl.xibuild @@ -0,0 +1,54 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="" + +PKG_VER=1.2.3 +SOURCE=https://musl.libc.org/releases/musl-$PKG_VER.tar.gz + +ADDITIONAL=" +0001-riscv64-define-ELF_NFPREG.patch +change-scheduler-functions-Linux-compatib.patch +fix-utmp-wtmp-paths.patch +handle-aux-at_base.patch +qsort_r.patch +syscall-cp-epoll.patch +" + +DESC="Implementation of the C standard library built on top of the Linux system call API" + +prepare () { + for p in *.patch; do + patch -Np1 -i $p || true + done +} + +build () { + CARCH=x86_64 + LDFLAGS="$LDFLAGS -Wl,-soname,libc.musl-${CARCH}.so.1" \ +./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --disable-gcc-wrapper + make +} + +package () { + make DESTDIR=$PKG_DEST install && + + install -d $PKG_DEST/etc + install -d $PKG_DEST/bin + install -d $PKG_DEST/lib + + ln -s /lib/ld-musl-x86_64.so.1 $PKG_DEST/bin/ldd + ln -s libc.so $PKG_DEST/usr/lib/libc.musl-x86_64.so.1 + + cat > $PKG_DEST/etc/ld-musl-x86_64.path << "EOF" +/lib +/usr/local/lib +/usr/lib +EOF + + rm $PKG_DEST/usr/include/utmpx.h +} + diff --git a/repo/system/musl/qsort_r.patch b/repo/system/musl/qsort_r.patch new file mode 100644 index 0000000..4ea6366 --- /dev/null +++ b/repo/system/musl/qsort_r.patch @@ -0,0 +1,213 @@ +Date: Tue, 9 Mar 2021 18:02:13 -0300 +From: Érico Nogueira +To: musl@...ts.openwall.com +Cc: Érico Nogueira +Subject: [PATCH v3] add qsort_r and make qsort a wrapper around it + +we make qsort a wrapper by providing a wrapper_cmp function that uses +the extra argument as a function pointer. should be optimized to a tail +call on most architectures, as long as it's built with +-fomit-frame-pointer, so the performance impact should be minimal. + +to keep the git history clean, for now qsort_r is implemented in qsort.c +and qsort is implemented in qsort_nr.c. qsort.c also received a few +trivial cleanups, including replacing (*cmp)() calls with cmp(). +qsort_nr.c contains only wrapper_cmp and qsort as a qsort_r wrapper +itself. +--- + +Following suggestions from IRC, as few changes as possible to the files, +a final clean up commit after this one would involve some git mv's (I +won't make a patch for it). Added weak_alias to force qsort to use +libc's qsort_r. + +If this can't be accepted due to the overhead on some archs (ppc, mips, +arm in some situations?), maybe we could revisit v2 of the patch? + + include/stdlib.h | 1 + + src/include/stdlib.h | 1 + + src/stdlib/qsort.c | 37 ++++++++++++++++++++----------------- + src/stdlib/qsort_nr.c | 14 ++++++++++++++ + 4 files changed, 36 insertions(+), 17 deletions(-) + create mode 100644 src/stdlib/qsort_nr.c + +diff --git a/include/stdlib.h b/include/stdlib.h +index b54a051f..0c0ced5f 100644 +--- a/include/stdlib.h ++++ b/include/stdlib.h +@@ -158,6 +158,7 @@ struct __locale_struct; + float strtof_l(const char *__restrict, char **__restrict, struct __locale_struct *); + double strtod_l(const char *__restrict, char **__restrict, struct __locale_struct *); + long double strtold_l(const char *__restrict, char **__restrict, struct __locale_struct *); ++void qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); + #endif + + #if defined(_LARGEFILE64_SOURCE) || defined(_BSD_SOURCE) +diff --git a/src/include/stdlib.h b/src/include/stdlib.h +index e9da2015..812b04de 100644 +--- a/src/include/stdlib.h ++++ b/src/include/stdlib.h +@@ -8,6 +8,7 @@ hidden void __env_rm_add(char *, char *); + hidden int __mkostemps(char *, int, int); + hidden int __ptsname_r(int, char *, size_t); + hidden char *__randname(char *); ++hidden void __qsort_r (void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); + + hidden void *__libc_malloc(size_t); + hidden void *__libc_malloc_impl(size_t); +diff --git a/src/stdlib/qsort.c b/src/stdlib/qsort.c +index da58fd31..20e40dda 100644 +--- a/src/stdlib/qsort.c ++++ b/src/stdlib/qsort.c +@@ -24,6 +24,7 @@ + /* Smoothsort, an adaptive variant of Heapsort. Memory usage: O(1). + Run time: Worst case O(n log n), close to O(n) in the mostly-sorted case. */ + ++#define _BSD_SOURCE + #include + #include + #include +@@ -31,7 +32,7 @@ + #include "atomic.h" + #define ntz(x) a_ctz_l((x)) + +-typedef int (*cmpfun)(const void *, const void *); ++typedef int (*cmpfun)(const void *, const void *, void *); + + static inline int pntz(size_t p[2]) { + int r = ntz(p[0] - 1); +@@ -88,7 +89,7 @@ static inline void shr(size_t p[2], int n) + p[1] >>= n; + } + +-static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size_t lp[]) ++static void sift(unsigned char *head, size_t width, cmpfun cmp, void *arg, int pshift, size_t lp[]) + { + unsigned char *rt, *lf; + unsigned char *ar[14 * sizeof(size_t) + 1]; +@@ -99,10 +100,10 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size + rt = head - width; + lf = head - width - lp[pshift - 2]; + +- if((*cmp)(ar[0], lf) >= 0 && (*cmp)(ar[0], rt) >= 0) { ++ if(cmp(ar[0], lf, arg) >= 0 && cmp(ar[0], rt, arg) >= 0) { + break; + } +- if((*cmp)(lf, rt) >= 0) { ++ if(cmp(lf, rt, arg) >= 0) { + ar[i++] = lf; + head = lf; + pshift -= 1; +@@ -115,7 +116,7 @@ static void sift(unsigned char *head, size_t width, cmpfun cmp, int pshift, size + cycle(width, ar, i); + } + +-static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], int pshift, int trusty, size_t lp[]) ++static void trinkle(unsigned char *head, size_t width, cmpfun cmp, void *arg, size_t pp[2], int pshift, int trusty, size_t lp[]) + { + unsigned char *stepson, + *rt, *lf; +@@ -130,13 +131,13 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], + ar[0] = head; + while(p[0] != 1 || p[1] != 0) { + stepson = head - lp[pshift]; +- if((*cmp)(stepson, ar[0]) <= 0) { ++ if(cmp(stepson, ar[0], arg) <= 0) { + break; + } + if(!trusty && pshift > 1) { + rt = head - width; + lf = head - width - lp[pshift - 2]; +- if((*cmp)(rt, stepson) >= 0 || (*cmp)(lf, stepson) >= 0) { ++ if(cmp(rt, stepson, arg) >= 0 || cmp(lf, stepson, arg) >= 0) { + break; + } + } +@@ -150,11 +151,11 @@ static void trinkle(unsigned char *head, size_t width, cmpfun cmp, size_t pp[2], + } + if(!trusty) { + cycle(width, ar, i); +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + } + } + +-void qsort(void *base, size_t nel, size_t width, cmpfun cmp) ++void __qsort_r(void *base, size_t nel, size_t width, cmpfun cmp, void *arg) + { + size_t lp[12*sizeof(size_t)]; + size_t i, size = width * nel; +@@ -173,16 +174,16 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + + while(head < high) { + if((p[0] & 3) == 3) { +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + shr(p, 2); + pshift += 2; + } else { + if(lp[pshift - 1] >= high - head) { +- trinkle(head, width, cmp, p, pshift, 0, lp); ++ trinkle(head, width, cmp, arg, p, pshift, 0, lp); + } else { +- sift(head, width, cmp, pshift, lp); ++ sift(head, width, cmp, arg, pshift, lp); + } +- ++ + if(pshift == 1) { + shl(p, 1); + pshift = 0; +@@ -191,12 +192,12 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + pshift = 1; + } + } +- ++ + p[0] |= 1; + head += width; + } + +- trinkle(head, width, cmp, p, pshift, 0, lp); ++ trinkle(head, width, cmp, arg, p, pshift, 0, lp); + + while(pshift != 1 || p[0] != 1 || p[1] != 0) { + if(pshift <= 1) { +@@ -208,11 +209,13 @@ void qsort(void *base, size_t nel, size_t width, cmpfun cmp) + pshift -= 2; + p[0] ^= 7; + shr(p, 1); +- trinkle(head - lp[pshift] - width, width, cmp, p, pshift + 1, 1, lp); ++ trinkle(head - lp[pshift] - width, width, cmp, arg, p, pshift + 1, 1, lp); + shl(p, 1); + p[0] |= 1; +- trinkle(head - width, width, cmp, p, pshift, 1, lp); ++ trinkle(head - width, width, cmp, arg, p, pshift, 1, lp); + } + head -= width; + } + } ++ ++weak_alias(__qsort_r, qsort_r); +diff --git a/src/stdlib/qsort_nr.c b/src/stdlib/qsort_nr.c +new file mode 100644 +index 00000000..fe408fb1 +--- /dev/null ++++ b/src/stdlib/qsort_nr.c +@@ -0,0 +1,14 @@ ++#define _BSD_SOURCE ++#include ++ ++typedef int (*cmpfun)(const void *, const void *); ++ ++static int wrapper_cmp(const void *v1, const void *v2, void *cmp) ++{ ++ return ((cmpfun)cmp)(v1, v2); ++} ++ ++void qsort(void *base, size_t nel, size_t width, cmpfun cmp) ++{ ++ __qsort_r(base, nel, width, wrapper_cmp, cmp); ++} +-- +2.30.2 diff --git a/repo/system/musl/syscall-cp-epoll.patch b/repo/system/musl/syscall-cp-epoll.patch new file mode 100644 index 0000000..338620a --- /dev/null +++ b/repo/system/musl/syscall-cp-epoll.patch @@ -0,0 +1,16 @@ +diff --git a/src/linux/epoll.c b/src/linux/epoll.c +index deff5b10..93baa814 100644 +--- a/src/linux/epoll.c ++++ b/src/linux/epoll.c +@@ -24,9 +24,9 @@ int epoll_ctl(int fd, int op, int fd2, struct epoll_event *ev) + + int epoll_pwait(int fd, struct epoll_event *ev, int cnt, int to, const sigset_t *sigs) + { +- int r = __syscall(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); ++ int r = __syscall_cp(SYS_epoll_pwait, fd, ev, cnt, to, sigs, _NSIG/8); + #ifdef SYS_epoll_wait +- if (r==-ENOSYS && !sigs) r = __syscall(SYS_epoll_wait, fd, ev, cnt, to); ++ if (r==-ENOSYS && !sigs) r = __syscall_cp(SYS_epoll_wait, fd, ev, cnt, to); + #endif + return __syscall_ret(r); + } diff --git a/repo/system/ncurses.xibuild b/repo/system/ncurses.xibuild deleted file mode 100644 index 784ec63..0000000 --- a/repo/system/ncurses.xibuild +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make pkg-config" -DEPS="musl" - -PKG_VER=6.3 -SOURCE=https://invisible-mirror.net/archives/ncurses/ncurses-$PKG_VER.tar.gz - -DESC="curses emulation library" - -build () { - ./configure --prefix=/usr \ - --mandir=/usr/share/man \ - --with-shared \ - --without-debug \ - --without-normal \ - --enable-pc-files \ - --enable-widec \ - --with-pkg-config-libdir=/usr/lib/pkgconfig - make -} - - -package () { - make DESTDIR=$PKG_DEST install - - for lib in ncurses form panel menu ; do - rm -f $PKG_DEST/usr/lib/lib${lib}.so - echo "INPUT(-l${lib}w)" > $PKG_DEST/usr/lib/lib${lib}.so - ln -sf ${lib}w.pc $PKG_DEST/usr/lib/pkgconfig/${lib}.pc - done - - rm -f $PKG_DEST/usr/lib/libcursesw.so - echo "INPUT(-lncursesw)" > $PKG_DEST/usr/lib/libcursesw.so - ln -sf libncurses.so $PKG_DEST/usr/lib/libcurses.so - - # install docs - mkdir -p $PKG_DEST/usr/share/doc/ncurses-$PKG_VER - cp -R doc/* $PKG_DEST/usr/share/doc/ncurses-$PKG_VER -} diff --git a/repo/system/ncurses/ncurses.xibuild b/repo/system/ncurses/ncurses.xibuild new file mode 100644 index 0000000..784ec63 --- /dev/null +++ b/repo/system/ncurses/ncurses.xibuild @@ -0,0 +1,40 @@ +#!/bin/sh + +MAKEDEPS="make pkg-config" +DEPS="musl" + +PKG_VER=6.3 +SOURCE=https://invisible-mirror.net/archives/ncurses/ncurses-$PKG_VER.tar.gz + +DESC="curses emulation library" + +build () { + ./configure --prefix=/usr \ + --mandir=/usr/share/man \ + --with-shared \ + --without-debug \ + --without-normal \ + --enable-pc-files \ + --enable-widec \ + --with-pkg-config-libdir=/usr/lib/pkgconfig + make +} + + +package () { + make DESTDIR=$PKG_DEST install + + for lib in ncurses form panel menu ; do + rm -f $PKG_DEST/usr/lib/lib${lib}.so + echo "INPUT(-l${lib}w)" > $PKG_DEST/usr/lib/lib${lib}.so + ln -sf ${lib}w.pc $PKG_DEST/usr/lib/pkgconfig/${lib}.pc + done + + rm -f $PKG_DEST/usr/lib/libcursesw.so + echo "INPUT(-lncursesw)" > $PKG_DEST/usr/lib/libcursesw.so + ln -sf libncurses.so $PKG_DEST/usr/lib/libcurses.so + + # install docs + mkdir -p $PKG_DEST/usr/share/doc/ncurses-$PKG_VER + cp -R doc/* $PKG_DEST/usr/share/doc/ncurses-$PKG_VER +} diff --git a/repo/system/nettle.xibuild b/repo/system/nettle.xibuild deleted file mode 100644 index a0107c5..0000000 --- a/repo/system/nettle.xibuild +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="gmp" - -PKG_VER=3.7 -SOURCE=https://ftp.gnu.org/gnu/nettle/nettle-$PKG_VER.tar.gz -DESC="A low-level cryptographic library" - -build () { - - ./configure \ - --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/nettle/nettle.xibuild b/repo/system/nettle/nettle.xibuild new file mode 100644 index 0000000..a0107c5 --- /dev/null +++ b/repo/system/nettle/nettle.xibuild @@ -0,0 +1,19 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="gmp" + +PKG_VER=3.7 +SOURCE=https://ftp.gnu.org/gnu/nettle/nettle-$PKG_VER.tar.gz +DESC="A low-level cryptographic library" + +build () { + + ./configure \ + --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/networkmanager.xibuild b/repo/system/networkmanager.xibuild deleted file mode 100644 index 910b601..0000000 --- a/repo/system/networkmanager.xibuild +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -MAKEDEPS="grep meson ninja python intltool glib" -DEPS="libndp curl wpa_supplicant newt nss polkit libpsl dbus gobject-introspection dhcp eudev libintl modemmanager nspr mobile-broadband-provider-info python-gobject" - -PKG_VER=1.39.2 -SOURCE=https://download.gnome.org/sources/NetworkManager/${PKG_VER%.*}/NetworkManager-$PKG_VER.tar.xz - -ADDITIONAL=" -networkmanager.conf -networkmanager-dispatcher.initd -networkmanager.initd -networkmanager.rules -" - -DESC="Network connection manager and user applications" - -prepare () { - ggrep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/' - dbus-uuidgen --ensure -} - -build () { - mkdir build && - cd build && - meson \ - --prefix=/usr \ - -Dsystemdsystemunitdir=no \ - -Dudev_dir=/lib/udev \ - -Dmodify_system=true \ - -Dselinux=false \ - -Dsystemd_journal=false \ - -Dlibaudit=no \ - -Diwd=true \ - -Dppp=false \ - -Dconfig_plugins_default=ifupdown \ - -Difupdown=true \ - -Ddhcpcd=true \ - -Dconfig_dhcp_default=internal \ - -Dvapi=true \ - -Dtests="no" \ - -Dpolkit=true \ - -Dsession_tracking=no \ - -Dqt=false \ - -Dovs=false \ - -Dofono=true \ - -Dcrypto=nss \ - -Ddbus_conf_dir=/usr/share/dbus-1/system.d \ - -Ddocs=false \ - .. - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install && - mv $PKG_DEST/usr/share/doc/NetworkManager \ - $PKG_DEST/usr/share/doc/NetworkManager-$PKG_VER - - install -m644 -D networkmanager.rules \ - "$PKG_DEST/usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules" - - cd .. - install -m755 -D networkmanager.initd $PKG_DEST/etc/init.d/networkmanager - install -m755 -D networkmanager-dispatcher.initd $PKG_DEST/etc/init.d/networkmanager-dispatcher - install -m755 -D networkmanager.conf $PKG_DEST/etc/NetworkManager/NetworkManager.conf -} diff --git a/repo/system/networkmanager/networkmanager-dispatcher.initd b/repo/system/networkmanager/networkmanager-dispatcher.initd new file mode 100644 index 0000000..552cc15 --- /dev/null +++ b/repo/system/networkmanager/networkmanager-dispatcher.initd @@ -0,0 +1,12 @@ +#!/sbin/openrc-run + +supervisor=supervise-daemon +command=/usr/libexec/nm-dispatcher +command_args_foreground="--persist" + +description="Network Manager Dispatcher Daemon" + +depend() { + need dbus + before networkmanager +} diff --git a/repo/system/networkmanager/networkmanager.conf b/repo/system/networkmanager/networkmanager.conf new file mode 100644 index 0000000..526d2e4 --- /dev/null +++ b/repo/system/networkmanager/networkmanager.conf @@ -0,0 +1,2 @@ +[main] +dhcp=internal diff --git a/repo/system/networkmanager/networkmanager.initd b/repo/system/networkmanager/networkmanager.initd new file mode 100644 index 0000000..4ca6a0d --- /dev/null +++ b/repo/system/networkmanager/networkmanager.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright (c) 2008 Saleem Abdulrasool +# Distributed under the terms of the GNU General Purpose License v2 +# $Header: $ + +supervisor=supervise-daemon +command=/usr/sbin/NetworkManager +command_args_foreground="-n" + +description="Network Manager Daemon" + +depend() { + need dbus + provide net +} + +# vim: set ft=gentoo-init-d ts=3 sw=3 et: diff --git a/repo/system/networkmanager/networkmanager.rules b/repo/system/networkmanager/networkmanager.rules new file mode 100644 index 0000000..66d21d6 --- /dev/null +++ b/repo/system/networkmanager/networkmanager.rules @@ -0,0 +1,9 @@ +// Let users in plugdev group modify NetworkManager +polkit.addRule(function(action, subject) { + if (action.id == "org.freedesktop.NetworkManager.settings.modify.system" && + subject.isInGroup("plugdev") && subject.active) { + return "yes"; + } +}); + + diff --git a/repo/system/networkmanager/networkmanager.xibuild b/repo/system/networkmanager/networkmanager.xibuild new file mode 100644 index 0000000..910b601 --- /dev/null +++ b/repo/system/networkmanager/networkmanager.xibuild @@ -0,0 +1,66 @@ +#!/bin/sh + +MAKEDEPS="grep meson ninja python intltool glib" +DEPS="libndp curl wpa_supplicant newt nss polkit libpsl dbus gobject-introspection dhcp eudev libintl modemmanager nspr mobile-broadband-provider-info python-gobject" + +PKG_VER=1.39.2 +SOURCE=https://download.gnome.org/sources/NetworkManager/${PKG_VER%.*}/NetworkManager-$PKG_VER.tar.xz + +ADDITIONAL=" +networkmanager.conf +networkmanager-dispatcher.initd +networkmanager.initd +networkmanager.rules +" + +DESC="Network connection manager and user applications" + +prepare () { + ggrep -rl '^#!.*python$' | xargs sed -i '1s/python/&3/' + dbus-uuidgen --ensure +} + +build () { + mkdir build && + cd build && + meson \ + --prefix=/usr \ + -Dsystemdsystemunitdir=no \ + -Dudev_dir=/lib/udev \ + -Dmodify_system=true \ + -Dselinux=false \ + -Dsystemd_journal=false \ + -Dlibaudit=no \ + -Diwd=true \ + -Dppp=false \ + -Dconfig_plugins_default=ifupdown \ + -Difupdown=true \ + -Ddhcpcd=true \ + -Dconfig_dhcp_default=internal \ + -Dvapi=true \ + -Dtests="no" \ + -Dpolkit=true \ + -Dsession_tracking=no \ + -Dqt=false \ + -Dovs=false \ + -Dofono=true \ + -Dcrypto=nss \ + -Ddbus_conf_dir=/usr/share/dbus-1/system.d \ + -Ddocs=false \ + .. + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install && + mv $PKG_DEST/usr/share/doc/NetworkManager \ + $PKG_DEST/usr/share/doc/NetworkManager-$PKG_VER + + install -m644 -D networkmanager.rules \ + "$PKG_DEST/usr/share/polkit-1/rules.d/01-org.freedesktop.NetworkManager.settings.modify.system.rules" + + cd .. + install -m755 -D networkmanager.initd $PKG_DEST/etc/init.d/networkmanager + install -m755 -D networkmanager-dispatcher.initd $PKG_DEST/etc/init.d/networkmanager-dispatcher + install -m755 -D networkmanager.conf $PKG_DEST/etc/NetworkManager/NetworkManager.conf +} diff --git a/repo/system/newt.xibuild b/repo/system/newt.xibuild deleted file mode 100644 index 6696f55..0000000 --- a/repo/system/newt.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make tcl python" -DEPS="gmp libxcrypt popt slang python tcl" - -PKG_VER=0.52.21 -SOURCE=https://releases.pagure.org/newt/newt-0.52.21.tar.gz -DESC="Not Erik's Windowing Toolkit - text mode windowing with slang" - -build () { - sed -e 's/^LIBNEWT =/#&/' \ - -e '/install -m 644 $(LIBNEWT)/ s/^/#/' \ - -e 's/$(LIBNEWT)/$(LIBNEWTSONAME)/g' \ - -i Makefile.in && - - ./configure --prefix=/usr \ - --with-gpm-support \ - --with-python=python3.10 && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/newt/newt.xibuild b/repo/system/newt/newt.xibuild new file mode 100644 index 0000000..6696f55 --- /dev/null +++ b/repo/system/newt/newt.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make tcl python" +DEPS="gmp libxcrypt popt slang python tcl" + +PKG_VER=0.52.21 +SOURCE=https://releases.pagure.org/newt/newt-0.52.21.tar.gz +DESC="Not Erik's Windowing Toolkit - text mode windowing with slang" + +build () { + sed -e 's/^LIBNEWT =/#&/' \ + -e '/install -m 644 $(LIBNEWT)/ s/^/#/' \ + -e 's/$(LIBNEWT)/$(LIBNEWTSONAME)/g' \ + -i Makefile.in && + + ./configure --prefix=/usr \ + --with-gpm-support \ + --with-python=python3.10 && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/nodejs.xibuild b/repo/system/nodejs.xibuild deleted file mode 100644 index b4918c8..0000000 --- a/repo/system/nodejs.xibuild +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -NAME="nodejs" -DESC="JavaScript runtime built on V8 engine - LTS version" - -MAKEDEPS="make " -DEPS="brotli sbase sort c-ares cacerts openssl musl libnghttp zlib " - -PKG_VER=16.14.2 -SOURCE="https://nodejs.org/dist/v$PKG_VER/node-v$PKG_VER.tar.gz" -ADDITIONAL="fix-build-with-system-c-ares.patch disable-running-gyp-on-shared-deps.patch " - -prepare () { - apply_patches -} - -build () { - - python3 configure.py --prefix=/usr \ - --shared-brotli \ - --shared-zlib \ - --shared-openssl \ - --shared-cares \ - --shared-nghttp2 \ - --ninja \ - --openssl-use-def-ca-store \ - --with-icu-default-data-dir=$(icu-config --icudatadir) \ - --with-intl=small-icu \ - --without-corepack \ - --without-npm - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/nodejs/disable-running-gyp-on-shared-deps.patch b/repo/system/nodejs/disable-running-gyp-on-shared-deps.patch new file mode 100644 index 0000000..f646201 --- /dev/null +++ b/repo/system/nodejs/disable-running-gyp-on-shared-deps.patch @@ -0,0 +1,20 @@ +From: Jakub Jirutka +Date: Sat, 26 Nov 2016 01:32:00 +0200 +Subject: Disable running gyp on shared deps + +Author: Stephen Gallagher + +Modified 2016-11-26 by Jakub Jirutka to update for +Node.js 7.2.0 + +--- a/Makefile ++++ b/Makefile +@@ -141,7 +141,7 @@ + echo "'test-code-cache' target is a noop" + + out/Makefile: config.gypi common.gypi node.gyp \ +- deps/uv/uv.gyp deps/llhttp/llhttp.gyp deps/zlib/zlib.gyp \ ++ deps/uv/uv.gyp deps/llhttp/llhttp.gyp \ + tools/v8_gypfiles/toolchain.gypi tools/v8_gypfiles/features.gypi \ + tools/v8_gypfiles/inspector.gypi tools/v8_gypfiles/v8.gyp + $(PYTHON) tools/gyp_node.py -f make diff --git a/repo/system/nodejs/fix-build-with-system-c-ares.patch b/repo/system/nodejs/fix-build-with-system-c-ares.patch new file mode 100644 index 0000000..8121891 --- /dev/null +++ b/repo/system/nodejs/fix-build-with-system-c-ares.patch @@ -0,0 +1,535 @@ +From aff98a5667c22794e2eaf658f6dfbee54cdd4a3b Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Thu, 12 Aug 2021 02:44:43 +0800 +Subject: [PATCH 1/2] deps: fix building with system c-ares on Linux +Patch-Source: https://github.com/nodejs/node/pull/39739 + +The change in #39724 breaks building with system c-ares +(`--shared-cares`): +``` +In file included from ../src/cares_wrap.cc:25: +../src/cares_wrap.h:25:11: fatal error: ares_nameser.h: No such file or +directory + 25 | # include + | ^~~~~~~~~~~~~~~~ +``` + +Since `ares_nameser.h` isn't available with a default system c-ares +installation, let's copy it as our private header here. + +Tested to build fine on Arch Linux with shared c-ares. +--- + src/ares_nameser.h | 482 +++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 482 insertions(+) + create mode 100644 src/ares_nameser.h + +diff --git a/src/ares_nameser.h b/src/ares_nameser.h +new file mode 100644 +index 000000000000..5270e5a3a6a0 +--- /dev/null ++++ b/src/ares_nameser.h +@@ -0,0 +1,482 @@ ++ ++#ifndef ARES_NAMESER_H ++#define ARES_NAMESER_H ++ ++#ifdef HAVE_ARPA_NAMESER_H ++# include ++#endif ++#ifdef HAVE_ARPA_NAMESER_COMPAT_H ++# include ++#endif ++ ++/* ============================================================================ ++ * arpa/nameser.h may or may not provide ALL of the below defines, so check ++ * each one individually and set if not ++ * ============================================================================ ++ */ ++ ++#ifndef NS_PACKETSZ ++# define NS_PACKETSZ 512 /* maximum packet size */ ++#endif ++ ++#ifndef NS_MAXDNAME ++# define NS_MAXDNAME 256 /* maximum domain name */ ++#endif ++ ++#ifndef NS_MAXCDNAME ++# define NS_MAXCDNAME 255 /* maximum compressed domain name */ ++#endif ++ ++#ifndef NS_MAXLABEL ++# define NS_MAXLABEL 63 ++#endif ++ ++#ifndef NS_HFIXEDSZ ++# define NS_HFIXEDSZ 12 /* #/bytes of fixed data in header */ ++#endif ++ ++#ifndef NS_QFIXEDSZ ++# define NS_QFIXEDSZ 4 /* #/bytes of fixed data in query */ ++#endif ++ ++#ifndef NS_RRFIXEDSZ ++# define NS_RRFIXEDSZ 10 /* #/bytes of fixed data in r record */ ++#endif ++ ++#ifndef NS_INT16SZ ++# define NS_INT16SZ 2 ++#endif ++ ++#ifndef NS_INADDRSZ ++# define NS_INADDRSZ 4 ++#endif ++ ++#ifndef NS_IN6ADDRSZ ++# define NS_IN6ADDRSZ 16 ++#endif ++ ++#ifndef NS_CMPRSFLGS ++# define NS_CMPRSFLGS 0xc0 /* Flag bits indicating name compression. */ ++#endif ++ ++#ifndef NS_DEFAULTPORT ++# define NS_DEFAULTPORT 53 /* For both TCP and UDP. */ ++#endif ++ ++/* ============================================================================ ++ * arpa/nameser.h should provide these enumerations always, so if not found, ++ * provide them ++ * ============================================================================ ++ */ ++#ifndef HAVE_ARPA_NAMESER_H ++ ++typedef enum __ns_class { ++ ns_c_invalid = 0, /* Cookie. */ ++ ns_c_in = 1, /* Internet. */ ++ ns_c_2 = 2, /* unallocated/unsupported. */ ++ ns_c_chaos = 3, /* MIT Chaos-net. */ ++ ns_c_hs = 4, /* MIT Hesiod. */ ++ /* Query class values which do not appear in resource records */ ++ ns_c_none = 254, /* for prereq. sections in update requests */ ++ ns_c_any = 255, /* Wildcard match. */ ++ ns_c_max = 65536 ++} ns_class; ++ ++typedef enum __ns_type { ++ ns_t_invalid = 0, /* Cookie. */ ++ ns_t_a = 1, /* Host address. */ ++ ns_t_ns = 2, /* Authoritative server. */ ++ ns_t_md = 3, /* Mail destination. */ ++ ns_t_mf = 4, /* Mail forwarder. */ ++ ns_t_cname = 5, /* Canonical name. */ ++ ns_t_soa = 6, /* Start of authority zone. */ ++ ns_t_mb = 7, /* Mailbox domain name. */ ++ ns_t_mg = 8, /* Mail group member. */ ++ ns_t_mr = 9, /* Mail rename name. */ ++ ns_t_null = 10, /* Null resource record. */ ++ ns_t_wks = 11, /* Well known service. */ ++ ns_t_ptr = 12, /* Domain name pointer. */ ++ ns_t_hinfo = 13, /* Host information. */ ++ ns_t_minfo = 14, /* Mailbox information. */ ++ ns_t_mx = 15, /* Mail routing information. */ ++ ns_t_txt = 16, /* Text strings. */ ++ ns_t_rp = 17, /* Responsible person. */ ++ ns_t_afsdb = 18, /* AFS cell database. */ ++ ns_t_x25 = 19, /* X_25 calling address. */ ++ ns_t_isdn = 20, /* ISDN calling address. */ ++ ns_t_rt = 21, /* Router. */ ++ ns_t_nsap = 22, /* NSAP address. */ ++ ns_t_nsap_ptr = 23, /* Reverse NSAP lookup (deprecated). */ ++ ns_t_sig = 24, /* Security signature. */ ++ ns_t_key = 25, /* Security key. */ ++ ns_t_px = 26, /* X.400 mail mapping. */ ++ ns_t_gpos = 27, /* Geographical position (withdrawn). */ ++ ns_t_aaaa = 28, /* Ip6 Address. */ ++ ns_t_loc = 29, /* Location Information. */ ++ ns_t_nxt = 30, /* Next domain (security). */ ++ ns_t_eid = 31, /* Endpoint identifier. */ ++ ns_t_nimloc = 32, /* Nimrod Locator. */ ++ ns_t_srv = 33, /* Server Selection. */ ++ ns_t_atma = 34, /* ATM Address */ ++ ns_t_naptr = 35, /* Naming Authority PoinTeR */ ++ ns_t_kx = 36, /* Key Exchange */ ++ ns_t_cert = 37, /* Certification record */ ++ ns_t_a6 = 38, /* IPv6 address (deprecates AAAA) */ ++ ns_t_dname = 39, /* Non-terminal DNAME (for IPv6) */ ++ ns_t_sink = 40, /* Kitchen sink (experimentatl) */ ++ ns_t_opt = 41, /* EDNS0 option (meta-RR) */ ++ ns_t_apl = 42, /* Address prefix list (RFC3123) */ ++ ns_t_ds = 43, /* Delegation Signer (RFC4034) */ ++ ns_t_sshfp = 44, /* SSH Key Fingerprint (RFC4255) */ ++ ns_t_rrsig = 46, /* Resource Record Signature (RFC4034) */ ++ ns_t_nsec = 47, /* Next Secure (RFC4034) */ ++ ns_t_dnskey = 48, /* DNS Public Key (RFC4034) */ ++ ns_t_tkey = 249, /* Transaction key */ ++ ns_t_tsig = 250, /* Transaction signature. */ ++ ns_t_ixfr = 251, /* Incremental zone transfer. */ ++ ns_t_axfr = 252, /* Transfer zone of authority. */ ++ ns_t_mailb = 253, /* Transfer mailbox records. */ ++ ns_t_maila = 254, /* Transfer mail agent records. */ ++ ns_t_any = 255, /* Wildcard match. */ ++ ns_t_zxfr = 256, /* BIND-specific, nonstandard. */ ++ ns_t_caa = 257, /* Certification Authority Authorization. */ ++ ns_t_max = 65536 ++} ns_type; ++ ++typedef enum __ns_opcode { ++ ns_o_query = 0, /* Standard query. */ ++ ns_o_iquery = 1, /* Inverse query (deprecated/unsupported). */ ++ ns_o_status = 2, /* Name server status query (unsupported). */ ++ /* Opcode 3 is undefined/reserved. */ ++ ns_o_notify = 4, /* Zone change notification. */ ++ ns_o_update = 5, /* Zone update message. */ ++ ns_o_max = 6 ++} ns_opcode; ++ ++typedef enum __ns_rcode { ++ ns_r_noerror = 0, /* No error occurred. */ ++ ns_r_formerr = 1, /* Format error. */ ++ ns_r_servfail = 2, /* Server failure. */ ++ ns_r_nxdomain = 3, /* Name error. */ ++ ns_r_notimpl = 4, /* Unimplemented. */ ++ ns_r_refused = 5, /* Operation refused. */ ++ /* these are for BIND_UPDATE */ ++ ns_r_yxdomain = 6, /* Name exists */ ++ ns_r_yxrrset = 7, /* RRset exists */ ++ ns_r_nxrrset = 8, /* RRset does not exist */ ++ ns_r_notauth = 9, /* Not authoritative for zone */ ++ ns_r_notzone = 10, /* Zone of record different from zone section */ ++ ns_r_max = 11, ++ /* The following are TSIG extended errors */ ++ ns_r_badsig = 16, ++ ns_r_badkey = 17, ++ ns_r_badtime = 18 ++} ns_rcode; ++ ++#endif /* HAVE_ARPA_NAMESER_H */ ++ ++ ++/* ============================================================================ ++ * arpa/nameser_compat.h typically sets these. However on some systems ++ * arpa/nameser.h does, but may not set all of them. Lets conditionally ++ * define each ++ * ============================================================================ ++ */ ++ ++#ifndef PACKETSZ ++# define PACKETSZ NS_PACKETSZ ++#endif ++ ++#ifndef MAXDNAME ++# define MAXDNAME NS_MAXDNAME ++#endif ++ ++#ifndef MAXCDNAME ++# define MAXCDNAME NS_MAXCDNAME ++#endif ++ ++#ifndef MAXLABEL ++# define MAXLABEL NS_MAXLABEL ++#endif ++ ++#ifndef HFIXEDSZ ++# define HFIXEDSZ NS_HFIXEDSZ ++#endif ++ ++#ifndef QFIXEDSZ ++# define QFIXEDSZ NS_QFIXEDSZ ++#endif ++ ++#ifndef RRFIXEDSZ ++# define RRFIXEDSZ NS_RRFIXEDSZ ++#endif ++ ++#ifndef INDIR_MASK ++# define INDIR_MASK NS_CMPRSFLGS ++#endif ++ ++#ifndef NAMESERVER_PORT ++# define NAMESERVER_PORT NS_DEFAULTPORT ++#endif ++ ++ ++/* opcodes */ ++#ifndef O_QUERY ++# define O_QUERY 0 /* ns_o_query */ ++#endif ++#ifndef O_IQUERY ++# define O_IQUERY 1 /* ns_o_iquery */ ++#endif ++#ifndef O_STATUS ++# define O_STATUS 2 /* ns_o_status */ ++#endif ++#ifndef O_NOTIFY ++# define O_NOTIFY 4 /* ns_o_notify */ ++#endif ++#ifndef O_UPDATE ++# define O_UPDATE 5 /* ns_o_update */ ++#endif ++ ++ ++/* response codes */ ++#ifndef SERVFAIL ++# define SERVFAIL ns_r_servfail ++#endif ++#ifndef NOTIMP ++# define NOTIMP ns_r_notimpl ++#endif ++#ifndef REFUSED ++# define REFUSED ns_r_refused ++#endif ++#if defined(_WIN32) && !defined(HAVE_ARPA_NAMESER_COMPAT_H) && defined(NOERROR) ++# undef NOERROR /* it seems this is already defined in winerror.h */ ++#endif ++#ifndef NOERROR ++# define NOERROR ns_r_noerror ++#endif ++#ifndef FORMERR ++# define FORMERR ns_r_formerr ++#endif ++#ifndef NXDOMAIN ++# define NXDOMAIN ns_r_nxdomain ++#endif ++/* Non-standard response codes, use numeric values */ ++#ifndef YXDOMAIN ++# define YXDOMAIN 6 /* ns_r_yxdomain */ ++#endif ++#ifndef YXRRSET ++# define YXRRSET 7 /* ns_r_yxrrset */ ++#endif ++#ifndef NXRRSET ++# define NXRRSET 8 /* ns_r_nxrrset */ ++#endif ++#ifndef NOTAUTH ++# define NOTAUTH 9 /* ns_r_notauth */ ++#endif ++#ifndef NOTZONE ++# define NOTZONE 10 /* ns_r_notzone */ ++#endif ++#ifndef TSIG_BADSIG ++# define TSIG_BADSIG 16 /* ns_r_badsig */ ++#endif ++#ifndef TSIG_BADKEY ++# define TSIG_BADKEY 17 /* ns_r_badkey */ ++#endif ++#ifndef TSIG_BADTIME ++# define TSIG_BADTIME 18 /* ns_r_badtime */ ++#endif ++ ++ ++/* classes */ ++#ifndef C_IN ++# define C_IN 1 /* ns_c_in */ ++#endif ++#ifndef C_CHAOS ++# define C_CHAOS 3 /* ns_c_chaos */ ++#endif ++#ifndef C_HS ++# define C_HS 4 /* ns_c_hs */ ++#endif ++#ifndef C_NONE ++# define C_NONE 254 /* ns_c_none */ ++#endif ++#ifndef C_ANY ++# define C_ANY 255 /* ns_c_any */ ++#endif ++ ++ ++/* types */ ++#ifndef T_A ++# define T_A 1 /* ns_t_a */ ++#endif ++#ifndef T_NS ++# define T_NS 2 /* ns_t_ns */ ++#endif ++#ifndef T_MD ++# define T_MD 3 /* ns_t_md */ ++#endif ++#ifndef T_MF ++# define T_MF 4 /* ns_t_mf */ ++#endif ++#ifndef T_CNAME ++# define T_CNAME 5 /* ns_t_cname */ ++#endif ++#ifndef T_SOA ++# define T_SOA 6 /* ns_t_soa */ ++#endif ++#ifndef T_MB ++# define T_MB 7 /* ns_t_mb */ ++#endif ++#ifndef T_MG ++# define T_MG 8 /* ns_t_mg */ ++#endif ++#ifndef T_MR ++# define T_MR 9 /* ns_t_mr */ ++#endif ++#ifndef T_NULL ++# define T_NULL 10 /* ns_t_null */ ++#endif ++#ifndef T_WKS ++# define T_WKS 11 /* ns_t_wks */ ++#endif ++#ifndef T_PTR ++# define T_PTR 12 /* ns_t_ptr */ ++#endif ++#ifndef T_HINFO ++# define T_HINFO 13 /* ns_t_hinfo */ ++#endif ++#ifndef T_MINFO ++# define T_MINFO 14 /* ns_t_minfo */ ++#endif ++#ifndef T_MX ++# define T_MX 15 /* ns_t_mx */ ++#endif ++#ifndef T_TXT ++# define T_TXT 16 /* ns_t_txt */ ++#endif ++#ifndef T_RP ++# define T_RP 17 /* ns_t_rp */ ++#endif ++#ifndef T_AFSDB ++# define T_AFSDB 18 /* ns_t_afsdb */ ++#endif ++#ifndef T_X25 ++# define T_X25 19 /* ns_t_x25 */ ++#endif ++#ifndef T_ISDN ++# define T_ISDN 20 /* ns_t_isdn */ ++#endif ++#ifndef T_RT ++# define T_RT 21 /* ns_t_rt */ ++#endif ++#ifndef T_NSAP ++# define T_NSAP 22 /* ns_t_nsap */ ++#endif ++#ifndef T_NSAP_PTR ++# define T_NSAP_PTR 23 /* ns_t_nsap_ptr */ ++#endif ++#ifndef T_SIG ++# define T_SIG 24 /* ns_t_sig */ ++#endif ++#ifndef T_KEY ++# define T_KEY 25 /* ns_t_key */ ++#endif ++#ifndef T_PX ++# define T_PX 26 /* ns_t_px */ ++#endif ++#ifndef T_GPOS ++# define T_GPOS 27 /* ns_t_gpos */ ++#endif ++#ifndef T_AAAA ++# define T_AAAA 28 /* ns_t_aaaa */ ++#endif ++#ifndef T_LOC ++# define T_LOC 29 /* ns_t_loc */ ++#endif ++#ifndef T_NXT ++# define T_NXT 30 /* ns_t_nxt */ ++#endif ++#ifndef T_EID ++# define T_EID 31 /* ns_t_eid */ ++#endif ++#ifndef T_NIMLOC ++# define T_NIMLOC 32 /* ns_t_nimloc */ ++#endif ++#ifndef T_SRV ++# define T_SRV 33 /* ns_t_srv */ ++#endif ++#ifndef T_ATMA ++# define T_ATMA 34 /* ns_t_atma */ ++#endif ++#ifndef T_NAPTR ++# define T_NAPTR 35 /* ns_t_naptr */ ++#endif ++#ifndef T_KX ++# define T_KX 36 /* ns_t_kx */ ++#endif ++#ifndef T_CERT ++# define T_CERT 37 /* ns_t_cert */ ++#endif ++#ifndef T_A6 ++# define T_A6 38 /* ns_t_a6 */ ++#endif ++#ifndef T_DNAME ++# define T_DNAME 39 /* ns_t_dname */ ++#endif ++#ifndef T_SINK ++# define T_SINK 40 /* ns_t_sink */ ++#endif ++#ifndef T_OPT ++# define T_OPT 41 /* ns_t_opt */ ++#endif ++#ifndef T_APL ++# define T_APL 42 /* ns_t_apl */ ++#endif ++#ifndef T_DS ++# define T_DS 43 /* ns_t_ds */ ++#endif ++#ifndef T_SSHFP ++# define T_SSHFP 44 /* ns_t_sshfp */ ++#endif ++#ifndef T_RRSIG ++# define T_RRSIG 46 /* ns_t_rrsig */ ++#endif ++#ifndef T_NSEC ++# define T_NSEC 47 /* ns_t_nsec */ ++#endif ++#ifndef T_DNSKEY ++# define T_DNSKEY 48 /* ns_t_dnskey */ ++#endif ++#ifndef T_TKEY ++# define T_TKEY 249 /* ns_t_tkey */ ++#endif ++#ifndef T_TSIG ++# define T_TSIG 250 /* ns_t_tsig */ ++#endif ++#ifndef T_IXFR ++# define T_IXFR 251 /* ns_t_ixfr */ ++#endif ++#ifndef T_AXFR ++# define T_AXFR 252 /* ns_t_axfr */ ++#endif ++#ifndef T_MAILB ++# define T_MAILB 253 /* ns_t_mailb */ ++#endif ++#ifndef T_MAILA ++# define T_MAILA 254 /* ns_t_maila */ ++#endif ++#ifndef T_ANY ++# define T_ANY 255 /* ns_t_any */ ++#endif ++#ifndef T_ZXFR ++# define T_ZXFR 256 /* ns_t_zxfr */ ++#endif ++#ifndef T_CAA ++# define T_CAA 257 /* ns_t_caa */ ++#endif ++#ifndef T_MAX ++# define T_MAX 65536 /* ns_t_max */ ++#endif ++ ++ ++#endif /* ARES_NAMESER_H */ + +From db4643979ee676b3a3d6cdf2fb597d399cf8013f Mon Sep 17 00:00:00 2001 +From: Felix Yan +Date: Fri, 13 Aug 2021 00:01:59 +0800 +Subject: [PATCH 2/2] build: ignore cpplint for third-party ares_nameser.h + +--- + Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/Makefile b/Makefile +index ec4c774748cd..c418995c53c1 100644 +--- a/Makefile ++++ b/Makefile +@@ -1289,6 +1289,7 @@ jslint-ci: lint-js-ci + LINT_CPP_ADDON_DOC_FILES_GLOB = test/addons/??_*/*.cc test/addons/??_*/*.h + LINT_CPP_ADDON_DOC_FILES = $(wildcard $(LINT_CPP_ADDON_DOC_FILES_GLOB)) + LINT_CPP_EXCLUDE ?= ++LINT_CPP_EXCLUDE += src/ares_nameser.h + LINT_CPP_EXCLUDE += src/node_root_certs.h + LINT_CPP_EXCLUDE += $(LINT_CPP_ADDON_DOC_FILES) + LINT_CPP_EXCLUDE += $(wildcard test/js-native-api/??_*/*.cc test/js-native-api/??_*/*.h test/node-api/??_*/*.cc test/node-api/??_*/*.h) diff --git a/repo/system/nodejs/nodejs.xibuild b/repo/system/nodejs/nodejs.xibuild new file mode 100644 index 0000000..b4918c8 --- /dev/null +++ b/repo/system/nodejs/nodejs.xibuild @@ -0,0 +1,36 @@ +#!/bin/sh + +NAME="nodejs" +DESC="JavaScript runtime built on V8 engine - LTS version" + +MAKEDEPS="make " +DEPS="brotli sbase sort c-ares cacerts openssl musl libnghttp zlib " + +PKG_VER=16.14.2 +SOURCE="https://nodejs.org/dist/v$PKG_VER/node-v$PKG_VER.tar.gz" +ADDITIONAL="fix-build-with-system-c-ares.patch disable-running-gyp-on-shared-deps.patch " + +prepare () { + apply_patches +} + +build () { + + python3 configure.py --prefix=/usr \ + --shared-brotli \ + --shared-zlib \ + --shared-openssl \ + --shared-cares \ + --shared-nghttp2 \ + --ninja \ + --openssl-use-def-ca-store \ + --with-icu-default-data-dir=$(icu-config --icudatadir) \ + --with-intl=small-icu \ + --without-corepack \ + --without-npm + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/nspr.xibuild b/repo/system/nspr.xibuild deleted file mode 100644 index 30a47da..0000000 --- a/repo/system/nspr.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl bash" - -PKG_VER=4.33 - -SOURCE=https://archive.mozilla.org/pub/nspr/releases/v$PKG_VER/src/nspr-$PKG_VER.tar.gz -DESC="Netscape Portable Runtime" - -build () { - cd nspr - ./configure \ - --prefix=/usr --with-mozilla --with-pthreads --enable-64bit - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/nspr/nspr.xibuild b/repo/system/nspr/nspr.xibuild new file mode 100644 index 0000000..30a47da --- /dev/null +++ b/repo/system/nspr/nspr.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl bash" + +PKG_VER=4.33 + +SOURCE=https://archive.mozilla.org/pub/nspr/releases/v$PKG_VER/src/nspr-$PKG_VER.tar.gz +DESC="Netscape Portable Runtime" + +build () { + cd nspr + ./configure \ + --prefix=/usr --with-mozilla --with-pthreads --enable-64bit + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/nss.xibuild b/repo/system/nss.xibuild deleted file mode 100644 index 07aa866..0000000 --- a/repo/system/nss.xibuild +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make gyp perl mercurial python patch" -DEPS="nspr libp11-kit sh zlib sqlite3" - -PKG_VER=3.74 - -SOURCE=https://archive.mozilla.org/pub/security/nss/releases/NSS_$(echo $PKG_VER | sed 's/\./_/g')_RTM/src/nss-$PKG_VER.tar.gz - -ADDITIONAL=" - nss-util.pc.in - nss-softokn.pc.in - nss-config.in - nss.pc.in -" - -DESC="Network Security Services" - -build () { - cd nss && - - make BUILD_OPT=1 \ - NSPR_INCLUDE_DIR=/usr/include/nspr \ - USE_SYSTEM_ZLIB=1 \ - ZLIB_LIBS=-lz \ - NSS_ENABLE_WERROR=0 \ - $([ $(uname -m) = x86_64 ] && echo USE_64=1) \ - $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1) - -} - -package () { - cd ../dist - - for p in lib/pkgconfig bin include/nss; do - mkdir -p $PKG_DEST/usr/$p - done - - install -m755 Linux*/lib/*.so $PKG_DEST/usr/lib - install -m644 Linux*/lib/*.chk $PKG_DEST/usr/lib - install -m644 Linux*/lib/libcrmf.a $PKG_DEST/usr/lib - - install -m755 -d $PKG_DEST/usr/include/nss - cp -RL public/nss/* $PKG_DEST/usr/include/nss - cp -RL private/nss/* $PKG_DEST/usr/include/nss - chmod 644 $PKG_DEST/usr/include/nss/* - - - for p in certutil nss-config pk12util; do - install -m755 Linux*/bin/$p $PKG_DEST/usr/bin - done - - install -m644 Linux*/lib/pkgconfig/nss.pc $PKG_DEST/usr/lib/pkgconfig - - ln -sf ./pkcs11/p11-kit-trust.so $PKG_DEST/usr/lib/libnssckbi.so - - cd .. - local _pc; for _pc in nss.pc nss-util.pc nss-softokn.pc; do - sed $_pc.in \ - -e "s,%libdir%,/usr/lib,g" \ - -e "s,%prefix%,/usr,g" \ - -e "s,%exec_prefix%,/usr/bin,g" \ - -e "s,%includedir%,/usr/include/nss,g" \ - -e "s,%SOFTOKEN_VERSION%,$PKG_VER,g" \ - -e "s,%NSPR_VERSION%,$PKG_VER,g" \ - -e "s,%NSS_VERSION%,$PKG_VER,g" \ - -e "s,%NSSUTIL_VERSION%,$PKG_VER,g" \ - > "$PKG_DEST"/usr/lib/pkgconfig/$_pc - done - ln -sf nss.pc "$PKG_DEST"/usr/lib/pkgconfig/mozilla-nss.pc - chmod 644 "$PKG_DEST"/usr/lib/pkgconfig/*.pc - -} diff --git a/repo/system/nss/nss-config.in b/repo/system/nss/nss-config.in new file mode 100644 index 0000000..f8f893e --- /dev/null +++ b/repo/system/nss/nss-config.in @@ -0,0 +1,145 @@ +#!/bin/sh + +prefix=@prefix@ + +major_version=@MOD_MAJOR_VERSION@ +minor_version=@MOD_MINOR_VERSION@ +patch_version=@MOD_PATCH_VERSION@ + +usage() +{ + cat <&2 +fi + +lib_ssl=yes +lib_smime=yes +lib_nss=yes +lib_nssutil=yes + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --prefix=*) + prefix=$optarg + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --includedir=*) + includedir=$optarg + ;; + --includedir) + echo_includedir=yes + ;; + --libdir=*) + libdir=$optarg + ;; + --libdir) + echo_libdir=yes + ;; + --version) + echo ${major_version}.${minor_version}.${patch_version} + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + ssl) + lib_ssl=yes + ;; + smime) + lib_smime=yes + ;; + nss) + lib_nss=yes + ;; + nssutil) + lib_nssutil=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +# Set variables that may be dependent upon other variables +if test -z "$exec_prefix"; then + exec_prefix=`pkg-config --variable=exec_prefix nss` +fi +if test -z "$includedir"; then + includedir=`pkg-config --variable=includedir nss` +fi +if test -z "$libdir"; then + libdir=`pkg-config --variable=libdir nss` +fi + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes"; then + echo $exec_prefix +fi + +if test "$echo_includedir" = "yes"; then + echo $includedir +fi + +if test "$echo_libdir" = "yes"; then + echo $libdir +fi + +if test "$echo_cflags" = "yes"; then + echo -I$includedir +fi + +if test "$echo_libs" = "yes"; then + libdirs="-Wl,-rpath-link,$libdir -L$libdir" + if test -n "$lib_ssl"; then + libdirs="$libdirs -lssl${major_version}" + fi + if test -n "$lib_smime"; then + libdirs="$libdirs -lsmime${major_version}" + fi + if test -n "$lib_nss"; then + libdirs="$libdirs -lnss${major_version}" + fi + if test -n "$lib_nssutil"; then + libdirs="$libdirs -lnssutil${major_version}" + fi + echo $libdirs +fi + diff --git a/repo/system/nss/nss-softokn.pc.in b/repo/system/nss/nss-softokn.pc.in new file mode 100644 index 0000000..50485ac --- /dev/null +++ b/repo/system/nss/nss-softokn.pc.in @@ -0,0 +1,11 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: NSS-SOFTOKN +Description: Network Security Services Softoken PKCS #11 Module +Version: %SOFTOKEN_VERSION% +Requires: nspr >= %NSPR_VERSION%, nss-util >= %NSSUTIL_VERSION% +Libs: -lfreebl3 -lnssdbm3 -lsoftokn3 +Cflags: -I${includedir}/private diff --git a/repo/system/nss/nss-util.pc.in b/repo/system/nss/nss-util.pc.in new file mode 100644 index 0000000..1310248 --- /dev/null +++ b/repo/system/nss/nss-util.pc.in @@ -0,0 +1,11 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: NSS-UTIL +Description: Network Security Services Utility Library +Version: %NSSUTIL_VERSION% +Requires: nspr >= %NSPR_VERSION% +Libs: -L${libdir} -lnssutil3 +Cflags: -I${includedir} diff --git a/repo/system/nss/nss.pc.in b/repo/system/nss/nss.pc.in new file mode 100644 index 0000000..d47b9e1 --- /dev/null +++ b/repo/system/nss/nss.pc.in @@ -0,0 +1,11 @@ +prefix=%prefix% +exec_prefix=%exec_prefix% +libdir=%libdir% +includedir=%includedir% + +Name: NSS +Description: Network Security Services +Version: %NSS_VERSION% +Requires: nspr >= %NSPR_VERSION% +Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3 +Cflags: -I${includedir} diff --git a/repo/system/nss/nss.xibuild b/repo/system/nss/nss.xibuild new file mode 100644 index 0000000..07aa866 --- /dev/null +++ b/repo/system/nss/nss.xibuild @@ -0,0 +1,73 @@ +#!/bin/sh + +MAKEDEPS="make gyp perl mercurial python patch" +DEPS="nspr libp11-kit sh zlib sqlite3" + +PKG_VER=3.74 + +SOURCE=https://archive.mozilla.org/pub/security/nss/releases/NSS_$(echo $PKG_VER | sed 's/\./_/g')_RTM/src/nss-$PKG_VER.tar.gz + +ADDITIONAL=" + nss-util.pc.in + nss-softokn.pc.in + nss-config.in + nss.pc.in +" + +DESC="Network Security Services" + +build () { + cd nss && + + make BUILD_OPT=1 \ + NSPR_INCLUDE_DIR=/usr/include/nspr \ + USE_SYSTEM_ZLIB=1 \ + ZLIB_LIBS=-lz \ + NSS_ENABLE_WERROR=0 \ + $([ $(uname -m) = x86_64 ] && echo USE_64=1) \ + $([ -f /usr/include/sqlite3.h ] && echo NSS_USE_SYSTEM_SQLITE=1) + +} + +package () { + cd ../dist + + for p in lib/pkgconfig bin include/nss; do + mkdir -p $PKG_DEST/usr/$p + done + + install -m755 Linux*/lib/*.so $PKG_DEST/usr/lib + install -m644 Linux*/lib/*.chk $PKG_DEST/usr/lib + install -m644 Linux*/lib/libcrmf.a $PKG_DEST/usr/lib + + install -m755 -d $PKG_DEST/usr/include/nss + cp -RL public/nss/* $PKG_DEST/usr/include/nss + cp -RL private/nss/* $PKG_DEST/usr/include/nss + chmod 644 $PKG_DEST/usr/include/nss/* + + + for p in certutil nss-config pk12util; do + install -m755 Linux*/bin/$p $PKG_DEST/usr/bin + done + + install -m644 Linux*/lib/pkgconfig/nss.pc $PKG_DEST/usr/lib/pkgconfig + + ln -sf ./pkcs11/p11-kit-trust.so $PKG_DEST/usr/lib/libnssckbi.so + + cd .. + local _pc; for _pc in nss.pc nss-util.pc nss-softokn.pc; do + sed $_pc.in \ + -e "s,%libdir%,/usr/lib,g" \ + -e "s,%prefix%,/usr,g" \ + -e "s,%exec_prefix%,/usr/bin,g" \ + -e "s,%includedir%,/usr/include/nss,g" \ + -e "s,%SOFTOKEN_VERSION%,$PKG_VER,g" \ + -e "s,%NSPR_VERSION%,$PKG_VER,g" \ + -e "s,%NSS_VERSION%,$PKG_VER,g" \ + -e "s,%NSSUTIL_VERSION%,$PKG_VER,g" \ + > "$PKG_DEST"/usr/lib/pkgconfig/$_pc + done + ln -sf nss.pc "$PKG_DEST"/usr/lib/pkgconfig/mozilla-nss.pc + chmod 644 "$PKG_DEST"/usr/lib/pkgconfig/*.pc + +} diff --git a/repo/system/nsss.xibuild b/repo/system/nsss.xibuild deleted file mode 100644 index 2623641..0000000 --- a/repo/system/nsss.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="skalibs" - -PKG_VER=0.2.0.1 - -SOURCE=https://skarnet.org/software/nsss/nsss-$PKG_VER.tar.gz - -DESC="Minimal competing implementation of glibc's Name Switch Service" - -build () { - ./configure --prefix=/usr \ - --exec-prefix=/usr \ - --with-dynlib=/usr/lib \ - --libexecdir=/usr/lib/nsss \ - --libdir=/usr/lib \ - --with-dynlib=/usr/lib \ - --enable-shared \ - --static-static - - make -} - -package () { - make DESTDIR=$PKG_DEST install - -} diff --git a/repo/system/nsss/nsss.xibuild b/repo/system/nsss/nsss.xibuild new file mode 100644 index 0000000..2623641 --- /dev/null +++ b/repo/system/nsss/nsss.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="skalibs" + +PKG_VER=0.2.0.1 + +SOURCE=https://skarnet.org/software/nsss/nsss-$PKG_VER.tar.gz + +DESC="Minimal competing implementation of glibc's Name Switch Service" + +build () { + ./configure --prefix=/usr \ + --exec-prefix=/usr \ + --with-dynlib=/usr/lib \ + --libexecdir=/usr/lib/nsss \ + --libdir=/usr/lib \ + --with-dynlib=/usr/lib \ + --enable-shared \ + --static-static + + make +} + +package () { + make DESTDIR=$PKG_DEST install + +} diff --git a/repo/system/openntpd.xibuild b/repo/system/openntpd.xibuild deleted file mode 100644 index 5dfd7e9..0000000 --- a/repo/system/openntpd.xibuild +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh - -NAME="openntpd" -DESC="Lightweight NTP server ported from OpenBSD" - -MAKEDEPS="make " -DEPS="libretls " - -PKG_VER=6.8p1 -SOURCE="https://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-$PKG_VER.tar.gz" -ADDITIONAL="libtls-standalone.patch ntp-user.patch -openntpd.confd -openntpd.initd -" - -prepare () { - apply_patches - autoreconf -vif -} - -build () { - ./configure \ - --prefix=/usr \ - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/share/man \ - --disable-static \ - --enable-https-constraint \ - --with-privsep-user=ntp - make -} - -package () { - make DESTDIR=$PKG_DEST install - - mkdir -p "$PKG_DEST/var/empty" - install -Dm755 "openntpd.initd" $PKG_DEST/etc/init.d/openntpd - install -Dm755 "openntpd.confd" $PKG_DEST/etc/conf.d/openntpd -} - -postinstall () { - - /usr/sbin/groupadd -fg 129 ntp && - /usr/sbin/useradd -c "ntp daemon owner" -d /var/lib/ntp -u 117 \ - -g ntp -s /bin/false ntp - - rc-update add openntpd -} diff --git a/repo/system/openntpd/libtls-standalone.patch b/repo/system/openntpd/libtls-standalone.patch new file mode 100644 index 0000000..3b5d8e4 --- /dev/null +++ b/repo/system/openntpd/libtls-standalone.patch @@ -0,0 +1,20 @@ +diff --git a/configure.ac b/configure.ac +index 88884c2..b0c0697 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -60,8 +60,13 @@ AM_CONDITIONAL([HAVE_CLOCK_GETRES], [test "x$ac_cv_func_clock_getres" = xyes]) + AM_CONDITIONAL([HAVE_CLOCK_GETTIME], [test "x$ac_cv_func_clock_gettime" = xyes]) + + # check for libtls +-AC_SEARCH_LIBS([tls_config_set_ca_mem],[tls], +- [LIBS="$LIBS -ltls -lssl -lcrypto"],,[-lssl -lcrypto]) ++PKG_CHECK_MODULES([LIBTLS], [libtls],[],[ ++ PKG_CHECK_MODULES([LIBTLS], [libtls-standalone]) ++ ]) ++AC_SEARCH_LIBS([tls_config_set_ca_mem],[tls tls-standalone], ++ [LIBS="$LIBS $LIBTLS_LIBS" ++ CFLAGS="$CFLAGS $LIBTLS_CFLAGS"], ++ ,[$LIBTLS_LIBS]) + AC_CHECK_FUNCS([tls_config_set_ca_mem]) + + # check if libtls uses 3-argument tls_write diff --git a/repo/system/openntpd/ntp-user.patch b/repo/system/openntpd/ntp-user.patch new file mode 100644 index 0000000..200676c --- /dev/null +++ b/repo/system/openntpd/ntp-user.patch @@ -0,0 +1,13 @@ +diff --git a/src/ntpd.h b/src/ntpd.h +index 6403391..cc41d42 100644 +--- a/src/ntpd.h ++++ b/src/ntpd.h +@@ -37,7 +37,7 @@ + #define MAXIMUM(a, b) ((a) > (b) ? (a) : (b)) + + #ifndef NTPD_USER +-#define NTPD_USER "_ntp" ++#define NTPD_USER "ntp" + #endif + + #ifndef SYSCONFDIR diff --git a/repo/system/openntpd/openntpd.confd b/repo/system/openntpd/openntpd.confd new file mode 100644 index 0000000..ec002b7 --- /dev/null +++ b/repo/system/openntpd/openntpd.confd @@ -0,0 +1,3 @@ +# See ntpd(8) man page ... some popular options: +# -s Set the time immediately at startup +#NTPD_OPTS= diff --git a/repo/system/openntpd/openntpd.initd b/repo/system/openntpd/openntpd.initd new file mode 100644 index 0000000..dc9a9ae --- /dev/null +++ b/repo/system/openntpd/openntpd.initd @@ -0,0 +1,14 @@ +#!/sbin/openrc-run + +name="NTP Server" +command=/usr/sbin/ntpd +command_args="-d $NTPD_OPTS" +command_background=yes +pidfile=/run/$RC_SVCNAME.pid +required_files=/etc/ntpd.conf + +depend() { + need net + provide ntp-client + use dns logger +} diff --git a/repo/system/openntpd/openntpd.xibuild b/repo/system/openntpd/openntpd.xibuild new file mode 100644 index 0000000..5dfd7e9 --- /dev/null +++ b/repo/system/openntpd/openntpd.xibuild @@ -0,0 +1,49 @@ +#!/bin/sh + +NAME="openntpd" +DESC="Lightweight NTP server ported from OpenBSD" + +MAKEDEPS="make " +DEPS="libretls " + +PKG_VER=6.8p1 +SOURCE="https://ftp.openbsd.org/pub/OpenBSD/OpenNTPD/openntpd-$PKG_VER.tar.gz" +ADDITIONAL="libtls-standalone.patch ntp-user.patch +openntpd.confd +openntpd.initd +" + +prepare () { + apply_patches + autoreconf -vif +} + +build () { + ./configure \ + --prefix=/usr \ + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/share/man \ + --disable-static \ + --enable-https-constraint \ + --with-privsep-user=ntp + make +} + +package () { + make DESTDIR=$PKG_DEST install + + mkdir -p "$PKG_DEST/var/empty" + install -Dm755 "openntpd.initd" $PKG_DEST/etc/init.d/openntpd + install -Dm755 "openntpd.confd" $PKG_DEST/etc/conf.d/openntpd +} + +postinstall () { + + /usr/sbin/groupadd -fg 129 ntp && + /usr/sbin/useradd -c "ntp daemon owner" -d /var/lib/ntp -u 117 \ + -g ntp -s /bin/false ntp + + rc-update add openntpd +} diff --git a/repo/system/openrc.xibuild b/repo/system/openrc.xibuild deleted file mode 100644 index fb99da4..0000000 --- a/repo/system/openrc.xibuild +++ /dev/null @@ -1,139 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="ifupdown-ng sbase musl" - -PKG_VER=0.44.10 -SOURCE=https://github.com/OpenRC/openrc/archive/refs/tags/$PKG_VER.zip -ADDITIONAL=" - 0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch - 0002-fsck-don-t-add-C0-to-busybox-fsck.patch - 0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch - 0004-make-consolefont-service-compatible-with-busyboxs-se.patch - 0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch - 0006-Add-support-for-starting-services-in-a-specified-VRF.patch - 0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch - 0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch - 0009-fix-bootmisc-mv-error.patch - 0010-noexec-devfs.patch - seedrng.patch - openrc.logrotate - hostname.initd - hwdrivers.initd - modules.initd - modloop.initd - networking.initd - modloop.confd - sysfsconf.initd - firstboot.initd - sysctl.initd - machine-id.initd - test-networking.sh - rc.conf -" - -DESC="Dependency based init system that works with sysvinit" - -# build borrowed from alpine linux -prepare () { - apply_patches - sed -i -e '/^sed/d' pkgconfig/Makefile - find ./ -name "Makefile" | xargs sed -i 's/ln -snf/ln -sf/g' -} - -build () { - export MKZSHCOMP=yes - export MKBASHCOMP=yes - make LIBDIR=/lib LIBEXECDIR=/lib/rc MKSYSVINIT=yes -} - -check () { - make check -} - -package () { - make LIBEXECDIR=/lib/rc DESTDIR="$PKG_DEST/" MKSYSVINIT=yes install - - # remove -n from ln in mtab, devfs - sed -i "s/ln -snf/ln -sf/g" $PKG_DEST/etc/init.d/mtab $PKG_DEST/etc/init.d/devfs - - ln -s openrc-init $PKG_DEST/sbin/init - - # we still use our ifup/ifdown based net config - #rm -f "$PKG_DEST"/etc/conf.d/network "$PKG_DEST"/etc/init.d/network - - # our hostname init script reads hostname from /etc/hostname - rm -f "$pkgdir"/etc/conf.d/hostname - - - # we override some of the scripts - for i in *.initd; do - j=${i##*/} - install -Dm755 $i "$PKG_DEST"/etc/init.d/${j%.initd} - done - - # we override some of the conf.d files - for i in *.confd; do - j=${i##*/} - install -Dm644 $i "$PKG_DEST"/etc/conf.d/${j%.confd} - done - - # additional documentation considered useful - mkdir -p "$PKG_DEST"/usr/share/doc/openrc/ - install -m644 ChangeLog ./*.md "$PKG_DEST"/usr/share/doc/openrc/ - - # we use a virtual keymaps services to allow users to set their - # keymaps either with the OpenRC loadkeys service provided by - # the kbd aport or with the loadkmap service provided by the - # busybox-initscripts aport. - rm -f "$PKG_DEST/etc/init.d/keymaps" \ - "$PKG_DEST/etc/conf.d/keymaps" - - install -Dm644 openrc.logrotate $PKG_DEST/etc/logrotate.d/openrc - install -d "$PKG_DEST"/etc/local.d "$PKG_DEST"/run - - # openrc upstream removed service(8) for whatever reason, put it back - ln -s /sbin/rc-service $PKG_DEST/sbin/service - - # remove deprecated /sbin/runscript to avoid conflict with minicom - rm $PKG_DEST/sbin/runscript - - #spawn ttys - for x in tty1 tty2 tty3 tty4 tty5 tty6; do - ln -sf agetty $PKG_DEST/etc/init.d/agetty.$x - done - - rm $PKG_DEST/etc/rc.conf - install -m644 rc.conf $PKG_DEST/etc/rc.conf -} - -postinstall () { - mkdir -p /run/openrc - for dir in /libexec /lib; do - [ -d $dir/rc/init.d ] || continue - - for i in $dir/rc/init.d/* ; do - [ -e "$i" ] || continue - if [ -e /run/openrc/${i##*/} ]; then - rm -r $i - else - mv $i /run/openrc/ - fi - done - - rmdir $dir/rc/init.d $dir/rc /libexec 2>/dev/null - done - - # create rc.local compat - if [ -f /etc/rc.local ]; then - cat >/etc/local.d/rc.local-compat.start<< EOF -#!/bin/sh - -# this is only here for compatibility reasons -if [ -f /etc/rc.local ]; then - . /etc/rc.local -fi -EOF - chmod +x /etc/local.d/rc.local-compat.start - fi -} diff --git a/repo/system/openrc/0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch b/repo/system/openrc/0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch new file mode 100644 index 0000000..3d41060 --- /dev/null +++ b/repo/system/openrc/0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch @@ -0,0 +1,25 @@ +From 78245081fe109ed7777b79ba9c99890d56c21272 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 1 Feb 2017 04:04:52 +0000 +Subject: [PATCH] call /sbin/mkmntdirs in localmount OpenRC service + +--- + init.d/localmount.in | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/init.d/localmount.in b/init.d/localmount.in +index c571504a..14189396 100644 +--- a/init.d/localmount.in ++++ b/init.d/localmount.in +@@ -21,6 +21,8 @@ depend() + + start() + { ++ [ -x /sbin/mkmntdirs ] && mkmntdirs ++ + # Mount local filesystems in /etc/fstab. + # The types variable must start with no, and must be a type + local critical= types="noproc" x= no_netdev= rc= +-- +2.33.1 + diff --git a/repo/system/openrc/0002-fsck-don-t-add-C0-to-busybox-fsck.patch b/repo/system/openrc/0002-fsck-don-t-add-C0-to-busybox-fsck.patch new file mode 100644 index 0000000..1d79818 --- /dev/null +++ b/repo/system/openrc/0002-fsck-don-t-add-C0-to-busybox-fsck.patch @@ -0,0 +1,35 @@ +From b143f35a45d59708365a52e329fd8caa6475a9bb Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Tue, 28 Nov 2017 13:35:10 +0100 +Subject: [PATCH] fsck: don't add -C0 to busybox fsck + +--- + init.d/fsck.in | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/init.d/fsck.in b/init.d/fsck.in +index 7052d808..99a9ae4f 100644 +--- a/init.d/fsck.in ++++ b/init.d/fsck.in +@@ -82,7 +82,7 @@ start() + local skiptypes + skiptypes=$(printf 'no%s,' ${net_fs_list} ${extra_net_fs_list}) + [ "${skiptypes}" = "no," ] && skiptypes="" +- fsck_opts="$fsck_opts -C0 -T -t ${skiptypes}noopts=_netdev" ++ fsck_opts="$fsck_opts -T -t ${skiptypes}noopts=_netdev" + if [ -z "$fsck_passno" -a -z "$fsck_mnt" ]; then + fsck_args=${fsck_args:--A -p} + if echo 2>/dev/null >/.test.$$; then +@@ -90,6 +90,9 @@ start() + fsck_opts="$fsck_opts -R" + fi + fi ++ if [ "$(readlink -f $(which fsck))" != "/bin/busybox" ]; then ++ fsck_opts="$fsck_opts -C0" ++ fi + fi + + trap : INT QUIT +-- +2.33.1 + diff --git a/repo/system/openrc/0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch b/repo/system/openrc/0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch new file mode 100644 index 0000000..546ccb7 --- /dev/null +++ b/repo/system/openrc/0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch @@ -0,0 +1,70 @@ +From 17f33c1968a51484eefdafbfb5b8fef5ac13d215 Mon Sep 17 00:00:00 2001 +From: Natanael Copa +Date: Wed, 1 Feb 2017 04:17:14 +0000 +Subject: [PATCH] rc: pull in sysinit and boot as stacked levels when needed + +We need start services from sysinit and boot runlevel, even if the new +runlevel is empty. + +This fixes problem introduced with commit 7716bf31 (Fix stacked runlevel +support), at which the start_services list are no longer used to start +the services. + +This also make sure that all services in sysinit and boot runlevels are +started before switching to next. This was not guaranteed when switching +to a non-empty runlevel. + +Fixes issue #54. +--- + src/rc/rc.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/rc/rc.c b/src/rc/rc.c +index ef46925d..82786074 100644 +--- a/src/rc/rc.c ++++ b/src/rc/rc.c +@@ -729,6 +729,7 @@ int main(int argc, char **argv) + const char *bootlevel = NULL; + char *newlevel = NULL; + const char *systype = NULL; ++ RC_STRINGLIST *runlevel_chain; + RC_STRINGLIST *deporder = NULL; + RC_STRINGLIST *tmplist; + RC_STRING *service; +@@ -986,6 +987,7 @@ int main(int argc, char **argv) + main_hotplugged_services = rc_services_in_state(RC_SERVICE_HOTPLUGGED); + main_start_services = rc_services_in_runlevel_stacked(newlevel ? + newlevel : runlevel); ++ runlevel_chain = rc_runlevel_stacks(newlevel ? newlevel : runlevel); + if (strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SHUTDOWN) != 0 && + strcmp(newlevel ? newlevel : runlevel, RC_LEVEL_SYSINIT) != 0) + { +@@ -1003,6 +1005,7 @@ int main(int argc, char **argv) + tmplist = rc_services_in_runlevel(bootlevel); + TAILQ_CONCAT(main_start_services, tmplist, entries); + free(tmplist); ++ rc_stringlist_add(runlevel_chain, bootlevel); + } + if (main_hotplugged_services) { + TAILQ_FOREACH(service, main_hotplugged_services, +@@ -1011,6 +1014,7 @@ int main(int argc, char **argv) + service->value); + } + } ++ rc_stringlist_add(runlevel_chain, RC_LEVEL_SYSINIT); + } + + parallel = rc_conf_yesno("rc_parallel"); +@@ -1067,9 +1071,6 @@ int main(int argc, char **argv) + + /* If we have a list of services to start then... */ + if (main_start_services) { +- /* Get a list of the chained runlevels which compose the target runlevel */ +- RC_STRINGLIST *runlevel_chain = rc_runlevel_stacks(runlevel); +- + /* Loop through them in reverse order. */ + RC_STRING *rlevel; + TAILQ_FOREACH_REVERSE(rlevel, runlevel_chain, rc_stringlist, entries) +-- +2.33.1 + diff --git a/repo/system/openrc/0004-make-consolefont-service-compatible-with-busyboxs-se.patch b/repo/system/openrc/0004-make-consolefont-service-compatible-with-busyboxs-se.patch new file mode 100644 index 0000000..b92b5ac --- /dev/null +++ b/repo/system/openrc/0004-make-consolefont-service-compatible-with-busyboxs-se.patch @@ -0,0 +1,70 @@ +From 613fb7f437c42e0ed01b2366b597598235e64a2d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Wed, 17 Aug 2016 17:52:58 +0200 +Subject: [PATCH] make consolefont service compatible with busyboxs setfont + applet + +Compared to kdbs setfont program it doesn't support -O and -m. +--- + conf.d/consolefont | 11 ++--------- + init.d/consolefont.in | 7 ++----- + 2 files changed, 4 insertions(+), 14 deletions(-) + +diff --git a/conf.d/consolefont b/conf.d/consolefont +index e01ae842..75544b2f 100644 +--- a/conf.d/consolefont ++++ b/conf.d/consolefont +@@ -3,16 +3,9 @@ + # + # consolefont specifies the default font that you'd like Linux to use on the + # console. You can find a good selection of fonts in /usr/share/consolefonts; +-# you shouldn't specify the trailing ".psf.gz", just the font name below. +-# To use the default console font, comment out the CONSOLEFONT setting below. +-consolefont="default8x16" ++consolefont="default8x16.psf.gz" + + # consoletranslation is the charset map file to use. Leave commented to use + # the default one. Have a look in /usr/share/consoletrans for a selection of + # map files you can use. +-#consoletranslation="8859-1_to_uni" +- +-# unicodemap is the unicode map file to use. Leave commented to use the +-# default one. Have a look in /usr/share/unimaps for a selection of map files +-# you can use. +-#unicodemap="iso01" ++#consoletranslation="8859-1_to_uni.trans" +diff --git a/init.d/consolefont.in b/init.d/consolefont.in +index d65dd14c..ccb6ee87 100644 +--- a/init.d/consolefont.in ++++ b/init.d/consolefont.in +@@ -22,7 +22,6 @@ start() + { + ttyn=${rc_tty_number:-${RC_TTY_NUMBER:-12}} + consolefont=${consolefont:-${CONSOLEFONT}} +- unicodemap=${unicodemap:-${UNICODEMAP}} + consoletranslation=${consoletranslation:-${CONSOLETRANSLATION}} + + if [ -z "$consolefont" ]; then +@@ -43,9 +42,6 @@ start() + if [ -n "$consoletranslation" ]; then + param="$param -m $consoletranslation" + fi +- if [ -n "${unicodemap}" ]; then +- param="$param -u $unicodemap" +- fi + + # Set the console font + ebegin "Setting console font [$consolefont]" +@@ -63,7 +59,8 @@ start() + # Store the font so we can use it ASAP on boot + if [ $retval -eq 0 ] && checkpath -W "$RC_LIBEXECDIR"; then + mkdir -p "$RC_LIBEXECDIR"/console +- setfont -O "$RC_LIBEXECDIR"/console/font ++ zcat "/usr/share/consolefonts/$consolefont" \ ++ > "$RC_LIBEXECDIR"/console/font + fi + + return $retval +-- +2.33.1 + diff --git a/repo/system/openrc/0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch b/repo/system/openrc/0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch new file mode 100644 index 0000000..f25d984 --- /dev/null +++ b/repo/system/openrc/0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch @@ -0,0 +1,31 @@ +From a07970bf087c089f467eefa30c2476f17f6e9536 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Thu, 7 Mar 2019 16:55:53 +0100 +Subject: [PATCH] Support early loading of keymap if kbd is installed + +Early loading of the keymap with busybox was never supported and would +require modifying the save-keymaps services as well. Since no one +complained that it doesn't work with busybox so far just make it work +with kbd for now. +--- + sh/init-early.sh.Linux.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/sh/init-early.sh.Linux.in b/sh/init-early.sh.Linux.in +index f304e924..7571ff3d 100644 +--- a/sh/init-early.sh.Linux.in ++++ b/sh/init-early.sh.Linux.in +@@ -48,8 +48,8 @@ if service_present "$RC_DEFAULTLEVEL" consolefont || + fi + + # Try and set a keyboard map as early as possible +-if service_present "$RC_DEFAULTLEVEL" keymaps || +- service_present "$RC_BOOTLEVEL" keymaps; then ++if service_present "$RC_DEFAULTLEVEL" loadkeys || ++ service_present "$RC_BOOTLEVEL" loadkeys; then + kbd_mode $kmode -C "$CONSOLE" 2>/dev/null + if [ -r "$RC_LIBEXECDIR"/console/keymap ]; then + loadkeys -q "$RC_LIBEXECDIR"/console/keymap 2>/dev/null +-- +2.33.1 + diff --git a/repo/system/openrc/0006-Add-support-for-starting-services-in-a-specified-VRF.patch b/repo/system/openrc/0006-Add-support-for-starting-services-in-a-specified-VRF.patch new file mode 100644 index 0000000..6f7ed69 --- /dev/null +++ b/repo/system/openrc/0006-Add-support-for-starting-services-in-a-specified-VRF.patch @@ -0,0 +1,101 @@ +From c250503412b061e69a99cfe12514e47fc06b5885 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Fri, 14 Feb 2020 16:02:43 +0000 +Subject: [PATCH] Add support for starting services in a specified VRF. + +The venerable iproute2 utility has recently introduced support +for executing programs in specific VRFs which are virtualized +routing tables. These are typically used to isolate different +networking planes from each other, for security or flexibility +reasons. + +Services which use the normal supervisor/start-stop-daemon +pattern can be configured by setting the vrf variable in the +/etc/conf.d tree for the service. + +This allows for things like configuring the sshd service to +run in a management VRF, which is useful for high assurance +environments where the management plane is intended to be +isolated. + +Signed-off-by: Ariadne Conill +--- + sh/openrc-run.sh.in | 6 ++++++ + sh/runit.sh | 2 +- + sh/s6.sh | 2 +- + sh/start-stop-daemon.sh | 2 +- + sh/supervise-daemon.sh | 2 +- + 5 files changed, 10 insertions(+), 4 deletions(-) + +diff --git a/sh/openrc-run.sh.in b/sh/openrc-run.sh.in +index 5c84af45..a1f374b0 100644 +--- a/sh/openrc-run.sh.in ++++ b/sh/openrc-run.sh.in +@@ -236,6 +236,12 @@ if ! sourcex -e "$_conf_d/$RC_SVCNAME.$RC_RUNLEVEL"; then + fi + unset _conf_d + ++# If we are configured to run in a VRF, provide a hint for that ++RC_VRF_EXEC="" ++if [ -n "$vrf" ]; then ++ RC_VRF_EXEC="/sbin/ip vrf exec $vrf" ++fi ++ + # load service supervisor functions + sourcex "@LIBEXECDIR@/sh/runit.sh" + sourcex "@LIBEXECDIR@/sh/s6.sh" +diff --git a/sh/runit.sh b/sh/runit.sh +index 5d82c9f6..c0186a43 100644 +--- a/sh/runit.sh ++++ b/sh/runit.sh +@@ -23,7 +23,7 @@ runit_start() + local i=0 retval=1 + # it can take upto 5 seconds for runsv to start + while [ $i -lt 6 ] ; do +- if sv start "${service_link}" > /dev/null 2>&1; then ++ if ${RC_VRF_EXEC} sv start "${service_link}" > /dev/null 2>&1; then + retval=0 + break + fi +diff --git a/sh/s6.sh b/sh/s6.sh +index acbe965b..1f339703 100644 +--- a/sh/s6.sh ++++ b/sh/s6.sh +@@ -37,7 +37,7 @@ s6_start() + ln -sf "${s6_service_path}" "${s6_service_link}" + s6-svscanctl -na "${RC_SVCDIR}"/s6-scan + sleep 1.5 +- s6-svc -u "${s6_service_link}" ++ ${RC_VRF_EXEC} s6-svc -u "${s6_service_link}" + if [ -n "$s6_svwait_options_start" ]; then + s6-svwait ${s6_svwait_options_start} "${s6_service_link}" + fi +diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh +index 2e549ae1..5e7a1b88 100644 +--- a/sh/start-stop-daemon.sh ++++ b/sh/start-stop-daemon.sh +@@ -45,7 +45,7 @@ ssd_start() + #the eval call is necessary for cases like: + # command_args="this \"is a\" test" + # to work properly. +- eval start-stop-daemon --start \ ++ eval ${RC_VRF_EXEC} start-stop-daemon --start \ + --exec $command \ + ${chroot:+--chroot} $chroot \ + ${directory:+--chdir} $directory \ +diff --git a/sh/supervise-daemon.sh b/sh/supervise-daemon.sh +index e403a789..259b8166 100644 +--- a/sh/supervise-daemon.sh ++++ b/sh/supervise-daemon.sh +@@ -24,7 +24,7 @@ supervise_start() + # The eval call is necessary for cases like: + # command_args="this \"is a\" test" + # to work properly. +- eval supervise-daemon "${RC_SVCNAME}" --start \ ++ eval ${RC_VRF_EXEC} supervise-daemon "${RC_SVCNAME}" --start \ + ${retry:+--retry} $retry \ + ${directory:+--chdir} $directory \ + ${chroot:+--chroot} $chroot \ +-- +2.33.1 + diff --git a/repo/system/openrc/0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch b/repo/system/openrc/0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch new file mode 100644 index 0000000..34100ef --- /dev/null +++ b/repo/system/openrc/0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch @@ -0,0 +1,47 @@ +From f406231dc9a49b67ca558983de80513f95078309 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Wed, 8 Sep 2021 23:51:11 -0600 +Subject: [PATCH] Clean up staticroute config - remove irrelevant parts (for + BSD, Hurd) and suggest that route(8) is legacy. + +--- + conf.d/staticroute | 23 +++-------------------- + 1 file changed, 3 insertions(+), 20 deletions(-) + +diff --git a/conf.d/staticroute b/conf.d/staticroute +index 19d0961f..49d0e0bb 100644 +--- a/conf.d/staticroute ++++ b/conf.d/staticroute +@@ -1,26 +1,9 @@ +-# Static routes are defined differently depending on your operating +-# system, so please be sure to use the correct syntax. + # Do not use this file to define the default route. + # In all settings, multiple routes should be separated using ; or new lines. + +-# Define static routes on Linux using route. See route(8) for syntax. +-#staticroute="net 192.168.0.0 netmask 255.255.255.0 gw 10.73.1.1 +-#net 192.168.1.0 netmask 255.255.255.0 gw 10.73.1.1" +- + # Define static routes on Linux using iproute2. See ip(8) for syntax. + #staticiproute="192.168.0.0/24 via 10.73.1.1; 192.168.1.0/24 via 10.73.1.1" + +-# Define static routes on GNU/Hurd. See route(8) for syntax. +-# /etc/route.conf(5) takes precedence over this configuration. +-# FIXME: "net ..." not supported +-#staticroute="net 192.168.0.0 -netmask 255.255.255.0 --address 10.73.1.1 +-#net 192.168.1.0 -netmask 255.255.255.0 --address 10.73.1.1" +- +-# Define static routes on GNU/KFreeBSD. See route(8) for syntax. +-#staticroute="net 192.168.0.0 10.73.1.1 netmask 255.255.255.0 +-#net 192.168.1.0 10.73.1.1 netmask 255.255.255.0" +- +-# Define static routes on other BSD systems. See route(8) for syntax. +-# /etc/route.conf(5) takes precedence over this configuration. +-#staticroute="net 192.168.0.0 -netmask 255.255.255.0 10.73.1.1 +-#net 192.168.1.0 -netmask 255.255.255.0 10.73.1.1" ++# Or define static routes on Linux using route (legacy). See route(8) for syntax. ++#staticroute="net 192.168.0.0 netmask 255.255.255.0 gw 10.73.1.1 ++#net 192.168.1.0 netmask 255.255.255.0 gw 10.73.1.1" +-- +2.33.1 + diff --git a/repo/system/openrc/0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch b/repo/system/openrc/0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch new file mode 100644 index 0000000..f498d05 --- /dev/null +++ b/repo/system/openrc/0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch @@ -0,0 +1,44 @@ +From a756576ae62e4f24a2ea36e87053187cdfc1be63 Mon Sep 17 00:00:00 2001 +From: Ariadne Conill +Date: Wed, 13 Oct 2021 21:12:10 -0600 +Subject: [PATCH] bootmisc: switch wipe_tmp setting to no by default + +When wipe_tmp=yes, an insufficiently bounded rm -rf occurs that, +under specific unknown circumstances, can escape into other filesystems +resulting in data loss. + +See alpine/aports#13070. +--- + conf.d/bootmisc | 2 +- + init.d/bootmisc.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/conf.d/bootmisc b/conf.d/bootmisc +index dd5b08e0..5cf18d33 100644 +--- a/conf.d/bootmisc ++++ b/conf.d/bootmisc +@@ -3,7 +3,7 @@ clean_tmp_dirs="/tmp" + + # Should we wipe the tmp paths completely or just selectively remove known + # locks / files / etc... ? +-wipe_tmp="YES" ++wipe_tmp="NO" + + # Write the initial dmesg log into /var/log/dmesg after boot + # This may be useful if you need the kernel boot log afterwards +diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in +index b1a849a3..8485110a 100644 +--- a/init.d/bootmisc.in ++++ b/init.d/bootmisc.in +@@ -17,7 +17,7 @@ depend() + keyword -prefix -timeout + } + +-: ${wipe_tmp:=${WIPE_TMP:-yes}} ++: ${wipe_tmp:=${WIPE_TMP:-no}} + : ${log_dmesg:=${LOG_DMESG:-yes}} + + cleanup_tmp_dir() +-- +2.33.1 + diff --git a/repo/system/openrc/0009-fix-bootmisc-mv-error.patch b/repo/system/openrc/0009-fix-bootmisc-mv-error.patch new file mode 100644 index 0000000..e87f9bb --- /dev/null +++ b/repo/system/openrc/0009-fix-bootmisc-mv-error.patch @@ -0,0 +1,27 @@ +From: Dermot Bradley +Date: Sat, 29 Jan 2022 19:28 +0000 +Subject: prevent a bootmisc trying to move a nonexistant file + +During boot if the "previous_dmesg" setting is enabled in +/etc/conf.d/bootmisc then during the 1st boot of a machine the +bootmisc init.d script will attempt to move a nonexistant dmesg +file, so generating an error on the console. + +Modify the script to only move an existing file. + +Upstream has merged this as PR 496 so it will be in the next release. + +--- + +diff -aur a/init.d/bootmisc.in b/init.d/bootmisc.in +--- a/init.d/bootmisc.in ++++ b/init.d/bootmisc.in +@@ -226,7 +226,7 @@ + case "$RC_SYS" in + VSERVER|OPENVZ|LXC|SYSTEMD-NSPAWN) ;; + *) +- if yesno ${previous_dmesg:-no}; then ++ if yesno ${previous_dmesg:-no} && [ -e /var/log/dmesg ]; then + mv /var/log/dmesg /var/log/dmesg.old + fi + dmesg > /var/log/dmesg diff --git a/repo/system/openrc/0010-noexec-devfs.patch b/repo/system/openrc/0010-noexec-devfs.patch new file mode 100644 index 0000000..9a8928c --- /dev/null +++ b/repo/system/openrc/0010-noexec-devfs.patch @@ -0,0 +1,14 @@ +--- a/init.d/devfs.in ++++ b/init.d/devfs.in +@@ -24,8 +24,9 @@ mount_dev() + action=--mount + conf_d_dir="${RC_SERVICE%/*/*}/conf.d" + msg=Mounting +- # Some devices require exec, Bug #92921 +- mountopts="exec,nosuid,mode=0755" ++ # Some devices require exec, https://bugs.gentoo.org/92921 ++ # Users with such requirements can use an fstab entry for /dev ++ mountopts="noexec,nosuid,mode=0755" + if yesno ${skip_mount_dev:-no} ; then + einfo "/dev will not be mounted due to user request" + return 0 diff --git a/repo/system/openrc/firstboot.initd b/repo/system/openrc/firstboot.initd new file mode 100644 index 0000000..eac4ef8 --- /dev/null +++ b/repo/system/openrc/firstboot.initd @@ -0,0 +1,34 @@ +#!/sbin/openrc-run + +# The first boot init service + +# read kernel options +init_KOPT() { + eval "set -- $(cat /proc/cmdline 2>/dev/null)" + for opt; do + case "$opt" in + ssh_*=*) + eval "KOPT_${opt%%=*}='${opt#*=}'" ;; + esac + done +} + +start() { + rm -f /etc/runlevels/*/$RC_SVCNAME + init_KOPT + local rc=0 + ebegin "Starting ${RC_SVCNAME}" + if [ -n "$KOPT_ssh_key" ] && [ ! -f "/root/.ssh/authorized_keys" ]; then + einfo "Fetching ssh keys" + mkdir -pm 700 /root/.ssh + checkpath -fm 0600 /root/.ssh/authorized_keys + case "$KOPT_ssh_key" in + https://*|ftps://*|http://*) + wget -q "$KOPT_ssh_key" -O /root/.ssh/authorized_keys + rc=$?;; + *) echo "$KOPT_ssh_key" > /root/.ssh/authorized_keys;; + esac + fi + eend $rc +} + diff --git a/repo/system/openrc/hostname.initd b/repo/system/openrc/hostname.initd new file mode 100644 index 0000000..4581595 --- /dev/null +++ b/repo/system/openrc/hostname.initd @@ -0,0 +1,18 @@ +#!/sbin/openrc-run + +description="Sets the hostname of the machine." + +depend() { + keyword -prefix -lxc -docker +} + +start() { + if [ -s /etc/hostname ] ; then + name=$(cat /etc/hostname) + else + name="${hostname:-localhost}" + fi + ebegin "Setting hostname" + hostname $name + eend $? +} diff --git a/repo/system/openrc/hwdrivers.initd b/repo/system/openrc/hwdrivers.initd new file mode 100644 index 0000000..80184c9 --- /dev/null +++ b/repo/system/openrc/hwdrivers.initd @@ -0,0 +1,32 @@ +#!/sbin/openrc-run + +depend() { + need sysfs dev + before checkfs fsck + after modloop + keyword -vserver -lxc +} + +# Load hardware drivers +start() { + # check for boot option "nocoldplug" + if get_bootparam noautodetect; then + ewarn "Autodetection of hardware disabled from boot cmdline" + return 0 + fi + + ebegin "Loading hardware drivers" + find /sys -name modalias -type f -print0 | xargs -0 sort -u \ + | xargs modprobe -b -a 2> /dev/null + # we run it twice so we detect all devices + find /sys -name modalias -type f -print0 | xargs -0 sort -u \ + | xargs modprobe -b -a 2> /dev/null + + # check if framebuffer drivers got pulled in + if [ -e /dev/fb0 ] && ! [ -e /sys/module/fbcon ]; then + modprobe -b -q fbcon + fi + + eend 0 +} + diff --git a/repo/system/openrc/machine-id.initd b/repo/system/openrc/machine-id.initd new file mode 100644 index 0000000..bdd0698 --- /dev/null +++ b/repo/system/openrc/machine-id.initd @@ -0,0 +1,17 @@ +#!/sbin/openrc-run + +description="Generate machine-id if needed" + +depend() { + need root dev +} + +start() { + if [ -s /etc/machine-id ] ; then + return 0 + fi + ebegin "Generating machine-id" + dd if=/dev/urandom status=none bs=16 count=1 \ + | md5sum | cut -d' ' -f1 > /etc/machine-id + eend $? +} diff --git a/repo/system/openrc/modloop.confd b/repo/system/openrc/modloop.confd new file mode 100644 index 0000000..6966429 --- /dev/null +++ b/repo/system/openrc/modloop.confd @@ -0,0 +1,6 @@ +# Enable loadable module support when running from RAM +# when OverlayFS support is available in the kernel. +# 0 means default tmpfs size (50% of physical RAM). +# for more information please see kernel documention at: +# https://www.kernel.org/doc/Documentation/filesystems/tmpfs.txt +overlay_size=0 diff --git a/repo/system/openrc/modloop.initd b/repo/system/openrc/modloop.initd new file mode 100755 index 0000000..fb7006c --- /dev/null +++ b/repo/system/openrc/modloop.initd @@ -0,0 +1,153 @@ +#!/sbin/openrc-run + +# script that will mount image with modules + +depend() { + after dev-mount + before checkfs fsck hwdrivers modules hwclock dev sysfs + keyword -vserver -lxc +} + +# read kernel options +init_KOPT() { + for opt in $(cat /proc/cmdline 2>/dev/null); do + case "$opt" in + modloop=*|modloop_verify=*) + eval "KOPT_${opt%%=*}='${opt#*=}'" ;; + esac + done +} + +mountdirs() { + awk '$2 !~ /^\/(sys|proc|dev|run)/ && $2 != "/" {print $2}' /proc/mounts +} + +find_modloop() { + local dir="$1" + local kver=$(uname -r) + local oifs="$IFS" + IFS=$'\n' + set -- $(blkid "$dir"/boot/* "$dir"/*) + IFS="$oifs" + for line; do + img=${line%%:*} + verify_modloop "$img" || eerror "Failed to verify signature of $img!" + mount "$img" -o loop,ro /.modloop || continue + if [ -d /.modloop/modules/$kver ]; then + return 0 + fi + umount /.modloop + done + return 1 +} + +verify_modloop() { + local modloop=$1 key= + if ! yesno "${KOPT_modloop_verify:=yes}"; then + return 0 + fi + for key in /etc/apk/keys/*.pub; do + local sig=/var/cache/misc/${modloop##*/}.SIGN.RSA.${key##*/} + if [ -f "$sig" ]; then + if ! command -v openssl > /dev/null; then + ewarn "Missing openssl. Modloop verification disabled!" + return 0 + fi + einfo "Verifying modloop" + openssl dgst -sha1 -verify "$key" -signature "$sig" "$modloop" \ + >/dev/null 2>&1 || return 1 + fi + done +} + +find_backing_file() { + local dir="$1" + local dev=$(df -P "$dir" | tail -1 | awk '{print $1}') + cat /sys/block/${dev#/dev/}/loop/backing_file 2>/dev/null +} + +start() { + local modloop= mount_opts= modloop_dldir="/lib" + init_KOPT + + case "$KOPT_modloop" in + none) return 0;; + http://*|https://*|ftp://*) + modloop=$modloop_dldir/${KOPT_modloop##*/} + if [ ! -f "$modloop" ]; then + mkdir -p "$modloop_dldir" + wget -P "$modloop_dldir" "$KOPT_modloop" || eend 1 + fi + ;; + *) + for dir in $(mountdirs); do + if [ -f "$dir"/$KOPT_modloop ]; then + modloop="$dir/${KOPT_modloop##/}" + alpine_mnt="$dir" + break + fi + done + ;; + esac + + ebegin "Mounting modloop $modloop" + mkdir -p /.modloop + if [ -n "$modloop" ]; then + verify_modloop "$modloop" || eerror "Failed to verify signature of $img!" + mount -o loop,ro $modloop /.modloop + eend $? || return 1 + else + for dir in $(mountdirs); do + if find_modloop "$dir"; then + alpine_mnt="$dir" + break + fi + done + if [ -d /.modloop/modules/$(uname -r) ]; then + eend 0 + else + eend 1 || return 1 + fi + fi + + #use overlayfs if available and configured + if grep -q -w "overlay$" /proc/filesystems && [ ! -z ${unionfs_size+x} ]; then + ewarn "Use of unionfs_size is deprecated use overlay_size instead" + overlay_size="$unionfs_size" + fi + if grep -q -w "overlay$" /proc/filesystems && [ -n "$overlay_size" ]; then + ebegin "OverlayFS detected, mounting modloop rw" + [ "$overlay_size" != 0 ] && mount_ops="-o size=$overlay_size" + mkdir -p /.modoverlayfs /lib/modules + mount -t tmpfs $mount_ops tmpfs /.modoverlayfs + mkdir -p /.modoverlayfs/modules /.modoverlayfs/work + mount -t overlay -o upperdir=/.modoverlayfs/modules,lowerdir=/lib/modules:/.modloop/modules,workdir=/.modoverlayfs/work overlay /lib/modules + depmod -A + eend $? || return 1 + else + rm -rf /lib/modules && ln -sf /.modloop/modules /lib/ + fi + + # copy firmware if there are any + if [ -d $alpine_mnt/firmware ]; then + ebegin "Copying firmware from $alpine_mnt/firmware" + cp -R -a $alpine_mnt/firmware /lib/ + eend $? + elif [ -d /lib/modules/firmware ]; then + rmdir /lib/firmware 2>/dev/null \ + && ln -s /lib/modules/firmware /lib/ + fi + return 0 +} + +stop() { + local ret=0 + local mnt; for mnt in /lib/modules /.modoverlayfs /.modloop; do + if mountinfo --quiet "$mnt"; then + ebegin "Unmounting $mnt" + umount -d "$mnt" || ret=1 + fi + done + eend $ret || return 1 +} + diff --git a/repo/system/openrc/modules.initd b/repo/system/openrc/modules.initd new file mode 100644 index 0000000..3cd141e --- /dev/null +++ b/repo/system/openrc/modules.initd @@ -0,0 +1,80 @@ +#!/sbin/openrc-run + +description="Loads a user defined list of kernel modules." + +depend() +{ + before hwclock hwdrivers + keyword -openvz -prefix -vserver -lxc +} + +start() { + yesno $rc_verbose && verbose=yes + + ebegin "Loading modules" + eindent + for f in /lib/modules-load.d/*.conf \ + /usr/lib/modules-load.d/*.conf; do + + if ! [ -f "$f" ]; then + continue + fi + + if [ -f /etc/modules-load.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /etc/modules-load.d/${f##*/}" + continue + fi + + if [ -f /run/modules-load.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/modules-load.d/${f##*/}" + continue + fi + + veinfo "Processing $f" + sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < "$f" \ + | while read module args; do + modprobe -q $module $args + done + done + + if [ -f /etc/modules ]; then + veinfo "Processing /etc/modules" + sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < /etc/modules \ + | while read module args; do + modprobe -q $module $args + done + fi + + for f in /etc/modules-load.d/*.conf; do + if [ ! -f "$f" ]; then + continue + fi + + if [ -f /run/modules-load.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/modules-load.d/${f##*/}" + continue + fi + + veinfo "Processing $f" + sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < "$f" \ + | while read module args; do + modprobe -q $module $args + done + done + + for f in /run/modules-load.d/*.conf; do + if [ ! -f "$f" ]; then + continue + fi + + veinfo "Processing $f" + sed -e 's/\#.*//g' -e '/^[[:space:]]*$/d' < "$f" \ + | while read module args; do + modprobe -q $module $args + done + done + eoutdent + + eend $? +} + diff --git a/repo/system/openrc/networking.initd b/repo/system/openrc/networking.initd new file mode 100644 index 0000000..417f4a3 --- /dev/null +++ b/repo/system/openrc/networking.initd @@ -0,0 +1,88 @@ +#!/sbin/openrc-run + +# note that the spoofprotect, syncoockies and ip_forward options are set in +# /etc/sysctl.conf + +: ${cfgfile:="/etc/network/interfaces"} +: ${ifquery:="ifquery"} +: ${ifstate:="/run/ifstate"} + +single_iface="${RC_SVCNAME#*.}" +if [ "$single_iface" = "$RC_SVCNAME" ]; then + single_iface= +fi + +depend() { + need localmount + want dev-settle + after bootmisc hwdrivers modules + provide net + keyword -jail -prefix -vserver -docker +} + +# find interfaces we want to start +find_ifaces() { + if [ -n "$single_iface" ]; then + echo $single_iface + return 0 + fi + + if command -v "$ifquery" >/dev/null; then + $ifquery -i "$cfgfile" --list --auto + return + fi + + # fallback in case ifquery does not exist + awk '$1 == "auto" {for (i = 2; i <= NF; i = i + 1) printf("%s ", $i)}' "$cfgfile" +} + +# return the list of interfaces we should try stop +find_running_ifaces() { + if [ -n "$single_iface" ]; then + echo $single_iface + return 0 + fi + + if command -v "$ifquery" >/dev/null; then + $ifquery --state-file $ifstate -i "$cfgfile" --running + return + fi + + # fallback + awk -F= '{print $2}' $ifstate +} + +start() { + local iface= ret=1 + ebegin "Starting networking" + eindent + for iface in $(find_ifaces); do + local r=0 + ebegin "$iface" + if ! ifup -i "$cfgfile" $iface >/dev/null; then + ifdown -i "$cfgfile" $iface >/dev/null 2>&1 + r=1 + fi + # atleast one interface needs to be started for action + # to be success + eend $r && ret=0 + done + eoutdent + return $ret +} + +stop() { + local iface= + # Don't stop the network at shutdown. + yesno ${keep_network:-YES} && yesno $RC_GOINGDOWN && return 0 + + ebegin "Stopping networking" + eindent + for iface in $(find_running_ifaces); do + ebegin "$iface" + ifdown -i "$cfgfile" -f $iface >/dev/null + eend $? + done + eoutdent + return 0 +} diff --git a/repo/system/openrc/openrc.logrotate b/repo/system/openrc/openrc.logrotate new file mode 100644 index 0000000..5e5e64b --- /dev/null +++ b/repo/system/openrc/openrc.logrotate @@ -0,0 +1,4 @@ +/var/log/rc.log { + missingok + notifempty +} diff --git a/repo/system/openrc/openrc.post-install b/repo/system/openrc/openrc.post-install new file mode 100644 index 0000000..1c27350 --- /dev/null +++ b/repo/system/openrc/openrc.post-install @@ -0,0 +1,38 @@ +#!/bin/sh + +rc_update() { + local svc="$1" + local level="$2" + mkdir -p /etc/runlevels/$level + ln -sf /etc/init.d/$svc /etc/runlevels/$level +} + +if [ ! -d etc/rcS.d ] && [ ! -d etc/rcL.d ]; then + exit 0 +fi + +for i in etc/rc[SL].d/*; do + [ -L "$i" ] || continue + oldsvc=${i##*/S[0-9][0-9]} + # some services are renamed + case "$oldsvc" in + modutils) svc=modules;; + procps) svc=sysctl;; + bootmisc.sh) svc=bootmisc;; + keymap) svc=keymaps;; + rc.local) svc=local;; + *) svc=$oldsvc;; + esac + + # add the service to correct "runlevel" + case "$svc" in + syslog|klogd) + rc_update $svc sysinit;; + hwclock|modules|sysctl|hostname|keymaps|bootmisc) + rc_update $svc boot;; + *) rc_update $svc default;; + esac + + rm $i +done + diff --git a/repo/system/openrc/openrc.post-upgrade b/repo/system/openrc/openrc.post-upgrade new file mode 100644 index 0000000..8884202 --- /dev/null +++ b/repo/system/openrc/openrc.post-upgrade @@ -0,0 +1,35 @@ +#!/bin/sh + +# in 0.8.0-r1 the state dir moved from /libexec/rc/init.d to /lib/rc/init.d +# and with 0.10 it moved to /run/openrc + +mkdir -p /run/openrc +for dir in /libexec /lib; do + [ -d $dir/rc/init.d ] || continue + + for i in $dir/rc/init.d/* ; do + [ -e "$i" ] || continue + if [ -e /run/openrc/${i##*/} ]; then + rm -r $i + else + mv $i /run/openrc/ + fi + done + + rmdir $dir/rc/init.d $dir/rc /libexec 2>/dev/null +done + +# create rc.local compat +if [ -f /etc/rc.local ]; then + cat >/etc/local.d/rc.local-compat.start<<__EOF__ +#!/bin/sh + +# this is only here for compatibility reasons +if [ -f /etc/rc.local ]; then + . /etc/rc.local +fi +__EOF__ + chmod +x /etc/local.d/rc.local-compat.start +fi + +exit 0 diff --git a/repo/system/openrc/openrc.xibuild b/repo/system/openrc/openrc.xibuild new file mode 100644 index 0000000..fb99da4 --- /dev/null +++ b/repo/system/openrc/openrc.xibuild @@ -0,0 +1,139 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="ifupdown-ng sbase musl" + +PKG_VER=0.44.10 +SOURCE=https://github.com/OpenRC/openrc/archive/refs/tags/$PKG_VER.zip +ADDITIONAL=" + 0001-call-sbin-mkmntdirs-in-localmount-OpenRC-service.patch + 0002-fsck-don-t-add-C0-to-busybox-fsck.patch + 0003-rc-pull-in-sysinit-and-boot-as-stacked-levels-when-n.patch + 0004-make-consolefont-service-compatible-with-busyboxs-se.patch + 0005-Support-early-loading-of-keymap-if-kbd-is-installed.patch + 0006-Add-support-for-starting-services-in-a-specified-VRF.patch + 0007-Clean-up-staticroute-config-remove-irrelevant-parts-.patch + 0008-bootmisc-switch-wipe_tmp-setting-to-no-by-default.patch + 0009-fix-bootmisc-mv-error.patch + 0010-noexec-devfs.patch + seedrng.patch + openrc.logrotate + hostname.initd + hwdrivers.initd + modules.initd + modloop.initd + networking.initd + modloop.confd + sysfsconf.initd + firstboot.initd + sysctl.initd + machine-id.initd + test-networking.sh + rc.conf +" + +DESC="Dependency based init system that works with sysvinit" + +# build borrowed from alpine linux +prepare () { + apply_patches + sed -i -e '/^sed/d' pkgconfig/Makefile + find ./ -name "Makefile" | xargs sed -i 's/ln -snf/ln -sf/g' +} + +build () { + export MKZSHCOMP=yes + export MKBASHCOMP=yes + make LIBDIR=/lib LIBEXECDIR=/lib/rc MKSYSVINIT=yes +} + +check () { + make check +} + +package () { + make LIBEXECDIR=/lib/rc DESTDIR="$PKG_DEST/" MKSYSVINIT=yes install + + # remove -n from ln in mtab, devfs + sed -i "s/ln -snf/ln -sf/g" $PKG_DEST/etc/init.d/mtab $PKG_DEST/etc/init.d/devfs + + ln -s openrc-init $PKG_DEST/sbin/init + + # we still use our ifup/ifdown based net config + #rm -f "$PKG_DEST"/etc/conf.d/network "$PKG_DEST"/etc/init.d/network + + # our hostname init script reads hostname from /etc/hostname + rm -f "$pkgdir"/etc/conf.d/hostname + + + # we override some of the scripts + for i in *.initd; do + j=${i##*/} + install -Dm755 $i "$PKG_DEST"/etc/init.d/${j%.initd} + done + + # we override some of the conf.d files + for i in *.confd; do + j=${i##*/} + install -Dm644 $i "$PKG_DEST"/etc/conf.d/${j%.confd} + done + + # additional documentation considered useful + mkdir -p "$PKG_DEST"/usr/share/doc/openrc/ + install -m644 ChangeLog ./*.md "$PKG_DEST"/usr/share/doc/openrc/ + + # we use a virtual keymaps services to allow users to set their + # keymaps either with the OpenRC loadkeys service provided by + # the kbd aport or with the loadkmap service provided by the + # busybox-initscripts aport. + rm -f "$PKG_DEST/etc/init.d/keymaps" \ + "$PKG_DEST/etc/conf.d/keymaps" + + install -Dm644 openrc.logrotate $PKG_DEST/etc/logrotate.d/openrc + install -d "$PKG_DEST"/etc/local.d "$PKG_DEST"/run + + # openrc upstream removed service(8) for whatever reason, put it back + ln -s /sbin/rc-service $PKG_DEST/sbin/service + + # remove deprecated /sbin/runscript to avoid conflict with minicom + rm $PKG_DEST/sbin/runscript + + #spawn ttys + for x in tty1 tty2 tty3 tty4 tty5 tty6; do + ln -sf agetty $PKG_DEST/etc/init.d/agetty.$x + done + + rm $PKG_DEST/etc/rc.conf + install -m644 rc.conf $PKG_DEST/etc/rc.conf +} + +postinstall () { + mkdir -p /run/openrc + for dir in /libexec /lib; do + [ -d $dir/rc/init.d ] || continue + + for i in $dir/rc/init.d/* ; do + [ -e "$i" ] || continue + if [ -e /run/openrc/${i##*/} ]; then + rm -r $i + else + mv $i /run/openrc/ + fi + done + + rmdir $dir/rc/init.d $dir/rc /libexec 2>/dev/null + done + + # create rc.local compat + if [ -f /etc/rc.local ]; then + cat >/etc/local.d/rc.local-compat.start<< EOF +#!/bin/sh + +# this is only here for compatibility reasons +if [ -f /etc/rc.local ]; then + . /etc/rc.local +fi +EOF + chmod +x /etc/local.d/rc.local-compat.start + fi +} diff --git a/repo/system/openrc/rc.conf b/repo/system/openrc/rc.conf new file mode 100644 index 0000000..fdeb653 --- /dev/null +++ b/repo/system/openrc/rc.conf @@ -0,0 +1,313 @@ +# Global OpenRC configuration settings + +# Set to "YES" if you want the rc system to try and start services +# in parallel for a slight speed improvement. When running in parallel we +# prefix the service output with its name as the output will get +# jumbled up. +# WARNING: whilst we have improved parallel, it can still potentially lock +# the boot process. Don't file bugs about this unless you can supply +# patches that fix it without breaking other things! +rc_parallel="YES" + +# Set rc_interactive to "YES" and you'll be able to press the I key during +# boot so you can choose to start specific services. Set to "NO" to disable +# this feature. This feature is automatically disabled if rc_parallel is +# set to YES. +#rc_interactive="YES" + +# If we need to drop to a shell, you can specify it here. +# If not specified we use $SHELL, otherwise the one specified in /etc/passwd, +# otherwise /bin/sh +# Linux users could specify /sbin/sulogin +rc_shell=/bin/sh + +# Do we allow any started service in the runlevel to satisfy the dependency +# or do we want all of them regardless of state? For example, if net.eth0 +# and net.eth1 are in the default runlevel then with rc_depend_strict="NO" +# both will be started, but services that depend on 'net' will work if either +# one comes up. With rc_depend_strict="YES" we would require them both to +# come up. +#rc_depend_strict="YES" + +# rc_hotplug controls which services we allow to be hotplugged. +# A hotplugged service is one started by a dynamic dev manager when a matching +# hardware device is found. +# Hotplugged services appear in the "hotplugged" runlevel. +# If rc_hotplug is set to any value, we compare the name of this service +# to every pattern in the value, from left to right, and we allow the +# service to be hotplugged if it matches a pattern, or if it matches no +# patterns. Patterns can include shell wildcards. +# To disable services from being hotplugged, prefix patterns with "!". +#If rc_hotplug is not set or is empty, all hotplugging is disabled. +# Example - rc_hotplug="net.wlan !net.*" +# This allows net.wlan and any service not matching net.* to be hotplugged. +# Example - rc_hotplug="!net.*" +# This allows services that do not match "net.*" to be hotplugged. + +# rc_logger launches a logging daemon to log the entire rc process to +# /var/log/rc.log +# NOTE: Linux systems require the devfs service to be started before +# logging can take place and as such cannot log the sysinit runlevel. +#rc_logger="NO" + +# Through rc_log_path you can specify a custom log file. +# The default value is: /var/log/rc.log +#rc_log_path="/var/log/rc.log" + +# If you want verbose output for OpenRC, set this to yes. If you want +# verbose output for service foo only, set it to yes in /etc/conf.d/foo. +#rc_verbose=no + +# By default we filter the environment for our running scripts. To allow other +# variables through, add them here. Use a * to allow all variables through. +#rc_env_allow="VAR1 VAR2" + +# By default we assume that all daemons will start correctly. +# However, some do not - a classic example is that they fork and return 0 AND +# then child barfs on a configuration error. Or the daemon has a bug and the +# child crashes. You can set the number of milliseconds start-stop-daemon +# waits to check that the daemon is still running after starting here. +# The default is 0 - no checking. +#rc_start_wait=100 + +# rc_nostop is a list of services which will not stop when changing runlevels. +# This still allows the service itself to be stopped when called directly. +#rc_nostop="" + +# rc will attempt to start crashed services by default. +# However, it will not stop them by default as that could bring down other +# critical services. +#rc_crashed_stop=NO +#rc_crashed_start=YES + +# Set rc_nocolor to yes if you do not want colors displayed in OpenRC +# output. +#rc_nocolor=NO + +############################################################################## +# MISC CONFIGURATION VARIABLES +# There variables are shared between many init scripts + +# Set unicode to YES to turn on unicode support for keyboards and screens. +unicode="YES" + +# This is how long fuser should wait for a remote server to respond. The +# default is 60 seconds, but it can be adjusted here. +#rc_fuser_timeout=60 + +# Below is the default list of network fstypes. +# +# afs ceph cifs coda davfs fuse fuse.sshfs gfs glusterfs lustre ncpfs +# nfs nfs4 ocfs2 shfs smbfs +# +# If you would like to add to this list, you can do so by adding your +# own fstypes to the following variable. +#extra_net_fs_list="" + +############################################################################## +# SERVICE CONFIGURATION VARIABLES +# These variables are documented here, but should be configured in +# /etc/conf.d/foo for service foo and NOT enabled here unless you +# really want them to work on a global basis. +# If your service has characters in its name which are not legal in +# shell variable names and you configure the variables for it in this +# file, those characters should be replaced with underscores in the +# variable names as shown below. + +# Some daemons are started and stopped via start-stop-daemon. +# We can set some things on a per service basis, like the nicelevel. +#SSD_NICELEVEL="-19" +# Or the ionice level. The format is class[:data] , just like the +# --ionice start-stop-daemon parameter. +#SSD_IONICELEVEL="2:2" + +# Pass ulimit parameters +# If you are using bash in POSIX mode for your shell, note that the +# ulimit command uses a block size of 512 bytes for the -c and -f +# options +#rc_ulimit="-u 30" + +# It's possible to define extra dependencies for services like so +#rc_config="/etc/foo" +#rc_need="openvpn" +#rc_use="net.eth0" +#rc_after="clock" +#rc_before="local" +#rc_provide="!net" + +# You can also enable the above commands here for each service. Below is an +# example for service foo. +#rc_foo_config="/etc/foo" +#rc_foo_need="openvpn" +#rc_foo_after="clock" + +# Below is an example for service foo-bar. Note that the '-' is illegal +# in a shell variable name, so we convert it to an underscore. +# example for service foo-bar. +#rc_foo_bar_config="/etc/foo-bar" +#rc_foo_bar_need="openvpn" +#rc_foo_bar_after="clock" + +# You can also remove dependencies. +# This is mainly used for saying which services do NOT provide net. +#rc_net_tap0_provide="!net" + +# This is the subsystem type. +# It is used to match against keywords set by the keyword call in the +# depend function of service scripts. +# +# It should be set to the value representing the environment this file is +# PRESENTLY in, not the virtualization the environment is capable of. +# If it is commented out, automatic detection will be used. +# +# The list below shows all possible settings as well as the host +# operating systems where they can be used and autodetected. +# +# "" - nothing special +# "docker" - Docker container manager (Linux) +# "jail" - Jail (DragonflyBSD or FreeBSD) +# "lxc" - Linux Containers +# "openvz" - Linux OpenVZ +# "prefix" - Prefix +# "rkt" - CoreOS container management system (Linux) +# "subhurd" - Hurd subhurds (to be checked) +# "systemd-nspawn" - Container created by systemd-nspawn (Linux) +# "uml" - Usermode Linux +# "vserver" - Linux vserver +# "xen0" - Xen0 Domain (Linux and NetBSD) +# "xenU" - XenU Domain (Linux and NetBSD) +#rc_sys="" + +# if you use openrc-init, which is currently only available on Linux, +# this is the default runlevel to activate after "sysinit" and "boot" +# when booting. +#rc_default_runlevel="default" + +# on Linux and Hurd, this is the number of ttys allocated for logins +# It is used in the consolefont, keymaps, numlock and termencoding +# service scripts. +rc_tty_number=12 + +############################################################################## +# LINUX CGROUPS RESOURCE MANAGEMENT + +# This sets the mode used to mount cgroups. +# "hybrid" mounts cgroups version 2 on /sys/fs/cgroup/unified and +# cgroups version 1 on /sys/fs/cgroup. +# "legacy" mounts cgroups version 1 on /sys/fs/cgroup +# "unified" mounts cgroups version 2 on /sys/fs/cgroup +#rc_cgroup_mode="hybrid" + +# This is a list of controllers which should be enabled for cgroups version 2 +# when hybrid mode is being used. +# Controllers listed here will not be available for cgroups version 1. +#rc_cgroup_controllers="" + +# This variable contains the cgroups version 2 settings for your services. +# If this is set in this file, the settings will apply to all services. +# If you want different settings for each service, place the settings in +# /etc/conf.d/foo for service foo. +# The format is to specify the setting and value followed by a newline. +# Multiple settings and values can be specified. +# For example, you would use this to set the maximum memory and maximum +# number of pids for a service. +#rc_cgroup_settings=" +#memory.max 10485760 +#pids.max max +#" +# +# For more information about the adjustments that can be made with +# cgroups version 2, see Documentation/cgroups-v2.txt in the linux kernel +# source tree. +#rc_cgroup_settings="" + +# This switch controls whether or not cgroups version 1 controllers are +# individually mounted under +# /sys/fs/cgroup in hybrid or legacy mode. +#rc_controller_cgroups="YES" + +# The following setting turns on the memory.use_hierarchy setting in the +# root memory cgroup for cgroups v1. +# It must be set to yes in this file if you want this functionality. +#rc_cgroup_memory_use_hierarchy="NO" + +# The following settings allow you to set up values for the cgroups version 1 +# controllers for your services. +# They can be set in this file;, however, if you do this, the settings +# will apply to all of your services. +# If you want different settings for each service, place the settings in +# /etc/conf.d/foo for service foo. +# The format is to specify the names of the settings followed by their +# values. Each variable can hold multiple settings. +# For example, you would use this to set the cpu.shares setting in the +# cpu controller to 512 for your service. +# rc_cgroup_cpu=" +# cpu.shares 512 +# " +# +# For more information about the adjustments that can be made with +# cgroups version 1, see Documentation/cgroups-v1/* in the linux kernel +# source tree. + +# Set the blkio controller settings for this service. +#rc_cgroup_blkio="" + +# Set the cpu controller settings for this service. +#rc_cgroup_cpu="" + +# Add this service to the cpuacct controller (any value means yes). +#rc_cgroup_cpuacct="" + +# Set the cpuset controller settings for this service. +#rc_cgroup_cpuset="" + +# Set the devices controller settings for this service. +#rc_cgroup_devices="" + +# Set the hugetlb controller settings for this service. +#rc_cgroup_hugetlb="" + +# Set the memory controller settings for this service. +#rc_cgroup_memory="" + +# Set the net_cls controller settings for this service. +#rc_cgroup_net_cls="" + +# Set the net_prio controller settings for this service. +#rc_cgroup_net_prio="" + +# Set the pids controller settings for this service. +#rc_cgroup_pids="" + +# Set this to YES if you want all of the processes in a service's cgroup +# killed when the service is stopped or restarted. +# Be aware that setting this to yes means all of a service's +# child processes will be killed. Keep this in mind if you set this to +# yes here instead of for the individual services in +# /etc/conf.d/. +# To perform this cleanup manually for a stopped service, you can +# execute cgroup_cleanup with /etc/init.d/ cgroup_cleanup or +# rc-service cgroup_cleanup. +# The process followed in this cleanup is the following: +# 1. send stopsig (sigterm if it isn't set) to all processes left in the +# cgroup immediately followed by sigcont. +# 2. Send sighup to all processes in the cgroup if rc_send_sighup is +# yes. +# 3. delay for rc_timeout_stopsec seconds. +# 4. send sigkill to all processes in the cgroup unless disabled by +# setting rc_send_sigkill to no. +# rc_cgroup_cleanup="NO" + +# If this is yes, we will send sighup to the processes in the cgroup +# immediately after stopsig and sigcont. +#rc_send_sighup="NO" + +# This is the amount of time in seconds that we delay after sending sigcont +# and optionally sighup, before we optionally send sigkill to all +# processes in the # cgroup. +# The default is 90 seconds. +#rc_timeout_stopsec="90" + +# If this is set to no, we do not send sigkill to all processes in the +# cgroup. +#rc_send_sigkill="YES" diff --git a/repo/system/openrc/seedrng.patch b/repo/system/openrc/seedrng.patch new file mode 100644 index 0000000..ff61d81 --- /dev/null +++ b/repo/system/openrc/seedrng.patch @@ -0,0 +1,640 @@ +From 076c2552aeff88a27fe275dfaae61dedf4bb4bd5 Mon Sep 17 00:00:00 2001 +From: "Jason A. Donenfeld" +Date: Thu, 24 Mar 2022 22:07:16 -0600 +Subject: [PATCH] Use seedrng for seeding the random number generator + +The RNG can't actually be seeded from a shell script, due to the +reliance on ioctls. For this reason, the seedrng project provides a +basic script meant to be copy and pasted into projects like OpenRC and +tweaked as needed: https://git.zx2c4.com/seedrng/about/ + +This commit imports it into OpenRC and wires up /etc/init.d/urandom to +call it. It shouldn't be called by other things on the system, so it +lives in rc_sbindir. + +Closes #506. +Closes #507. + +Signed-off-by: Jason A. Donenfeld +--- + AUTHORS | 1 + + conf.d/urandom | 9 +- + init.d/urandom.in | 41 ++-- + src/rc/Makefile | 6 +- + src/rc/meson.build | 10 +- + src/rc/seedrng.c | 453 +++++++++++++++++++++++++++++++++++++++++++++ + 6 files changed, 499 insertions(+), 21 deletions(-) + create mode 100644 src/rc/seedrng.c + +diff --git a/AUTHORS b/AUTHORS +index 0616d5175..ede0f471b 100644 +--- a/AUTHORS ++++ b/AUTHORS +@@ -43,6 +43,7 @@ Ian Stakenvicius + Jakob Drexel + James Le Cuirot + Jan Psota ++Jason A. Donenfeld + Jason Zaman + Joe Harvell + Joe M +diff --git a/conf.d/urandom b/conf.d/urandom +index f721a2491..744e4f702 100644 +--- a/conf.d/urandom ++++ b/conf.d/urandom +@@ -2,4 +2,11 @@ + # (say for crypt swap), so you will need to customize this + # behavior. If you have /var on a separate partition, then + # make sure this path lives on your root device somewhere. +-urandom_seed="/var/lib/misc/random-seed" ++seed_dir="/var/lib/seedrng" ++lock_file="/var/run/seedrng.lock" ++ ++# Set this to true if you do not want seed files to actually ++# credit the RNG. Set this if you plan to replicate this ++# file system image and do not have the wherewithal to first ++# delete the contents of /var/lib/seedrng. ++skip_credit="false" +diff --git a/init.d/urandom.in b/init.d/urandom.in +index 0d6ab66e0..cda431fdb 100644 +--- a/init.d/urandom.in ++++ b/init.d/urandom.in +@@ -1,5 +1,5 @@ + #!@SBINDIR@/openrc-run +-# Copyright (c) 2007-2015 The OpenRC Authors. ++# Copyright (c) 2007-2022 The OpenRC Authors. + # See the Authors file at the top-level directory of this distribution and + # https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS + # +@@ -9,7 +9,10 @@ + # This file may not be copied, modified, propagated, or distributed + # except according to the terms contained in the LICENSE file. + +-: ${urandom_seed:=${URANDOM_SEED:-/var/lib/misc/random-seed}} ++export SEEDRNG_SEED_DIR="${seed_dir:-/var/lib/seedrng}" ++export SEEDRNG_LOCK_FILE="${lock_file:-/var/run/seedrng.lock}" ++export SEEDRNG_SKIP_CREDIT="${skip_credit:-false}" ++: ${urandom_seed:=${SEEDRNG_SEED_DIR}/../misc/random-seed} + description="Initializes the random number generator." + + depend() +@@ -21,33 +24,35 @@ depend() + + save_seed() + { +- local psz=1 +- +- if [ -e /proc/sys/kernel/random/poolsize ]; then +- : $(( psz = $(cat /proc/sys/kernel/random/poolsize) / 4096 )) +- fi +- + ( # sub shell to prevent umask pollution + umask 077 +- dd if=/dev/urandom of="$urandom_seed" count=${psz} 2>/dev/null ++ dd if=/dev/urandom of="$urandom_seed" count=1 2>/dev/null + ) + } + + start() + { +- [ -c /dev/urandom ] || return +- if [ -f "$urandom_seed" ]; then +- ebegin "Initializing random number generator" +- cat "$urandom_seed" > /dev/urandom +- eend $? "Error initializing random number generator" ++ if [ "$RC_UNAME" = Linux ]; then ++ seedrng ++ else ++ [ -c /dev/urandom ] || return ++ if [ -f "$urandom_seed" ]; then ++ ebegin "Initializing random number generator" ++ cat "$urandom_seed" > /dev/urandom ++ eend $? "Error initializing random number generator" ++ fi ++ rm -f "$urandom_seed" && save_seed + fi +- rm -f "$urandom_seed" && save_seed + return 0 + } + + stop() + { +- ebegin "Saving random seed" +- save_seed +- eend $? "Failed to save random seed" ++ if [ "$RC_UNAME" = Linux ]; then ++ seedrng ++ else ++ ebegin "Saving random seed" ++ save_seed ++ eend $? "Failed to save random seed" ++ fi + } +diff --git a/src/rc/Makefile b/src/rc/Makefile +index fd796d920..62539f134 100644 +--- a/src/rc/Makefile ++++ b/src/rc/Makefile +@@ -15,7 +15,7 @@ endif + + ifeq (${OS},Linux) + SRCS+= kill_all.c openrc-init.c openrc-shutdown.c rc-sysvinit.c broadcast.c \ +- rc-wtmp.c ++ rc-wtmp.c seedrng.c + endif + + CLEANFILES= version.h rc-selinux.o +@@ -47,6 +47,7 @@ RC_SBINPROGS= mark_service_starting mark_service_started \ + + ifeq (${OS},Linux) + RC_BINPROGS+= kill_all ++RC_SBINPROGS+= seedrng + SBINPROGS+= openrc-init openrc-shutdown + endif + +@@ -180,3 +181,6 @@ shell_var: shell_var.o + + swclock: swclock.o _usage.o rc-misc.o + ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} ++ ++seedrng: seedrng.o ++ ${CC} ${LOCAL_CFLAGS} ${LOCAL_LDFLAGS} ${CFLAGS} ${LDFLAGS} -o $@ $^ ${LDADD} +diff --git a/src/rc/meson.build b/src/rc/meson.build +index 8fdf3ac3b..b724c51f2 100644 +--- a/src/rc/meson.build ++++ b/src/rc/meson.build +@@ -268,7 +268,15 @@ if os == 'Linux' + link_with: [libeinfo,librc], + install: true, + install_dir: rc_bindir) +- endif ++ ++ executable('seedrng', ++ ['seedrng.c'], ++ c_args : cc_branding_flags, ++ include_directories: [incdir, einfo_incdir, rc_incdir], ++ link_with: [libeinfo, librc], ++ install: true, ++ install_dir: rc_sbindir) ++endif + + executable('shell_var', + ['shell_var.c'], +diff --git a/src/rc/seedrng.c b/src/rc/seedrng.c +new file mode 100644 +index 000000000..c1f941457 +--- /dev/null ++++ b/src/rc/seedrng.c +@@ -0,0 +1,453 @@ ++/* ++ * seedrng.c ++ * Seed kernel RNG from seed file, based on code from: ++ * https://git.zx2c4.com/seedrng/about/ ++ */ ++ ++/* ++ * Copyright (c) 2022 The OpenRC Authors. ++ * See the Authors file at the top-level directory of this distribution and ++ * https://github.com/OpenRC/openrc/blob/HEAD/AUTHORS ++ * ++ * This file is part of OpenRC. It is subject to the license terms in ++ * the LICENSE file found in the top-level directory of this ++ * distribution and at https://github.com/OpenRC/openrc/blob/HEAD/LICENSE ++ * This file may not be copied, modified, propagated, or distributed ++ * except according to the terms contained in the LICENSE file. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "rc.h" ++#include "einfo.h" ++#include "helpers.h" ++ ++#ifndef GRND_INSECURE ++#define GRND_INSECURE 0x0004 /* Apparently some headers don't ship with this yet. */ ++#endif ++ ++static const char *SEED_DIR; ++static const char *LOCK_FILE; ++static char *CREDITABLE_SEED; ++static char *NON_CREDITABLE_SEED; ++ ++enum blake2s_lengths { ++ BLAKE2S_BLOCK_LEN = 64, ++ BLAKE2S_HASH_LEN = 32, ++ BLAKE2S_KEY_LEN = 32 ++}; ++ ++enum seedrng_lengths { ++ MAX_SEED_LEN = 512, ++ MIN_SEED_LEN = BLAKE2S_HASH_LEN ++}; ++ ++struct blake2s_state { ++ uint32_t h[8]; ++ uint32_t t[2]; ++ uint32_t f[2]; ++ uint8_t buf[BLAKE2S_BLOCK_LEN]; ++ unsigned int buflen; ++ unsigned int outlen; ++}; ++ ++#define le32_to_cpup(a) le32toh(*(a)) ++#define cpu_to_le32(a) htole32(a) ++#ifndef ARRAY_SIZE ++#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) ++#endif ++#ifndef DIV_ROUND_UP ++#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) ++#endif ++ ++static inline void cpu_to_le32_array(uint32_t *buf, unsigned int words) ++{ ++ while (words--) { ++ *buf = cpu_to_le32(*buf); ++ ++buf; ++ } ++} ++ ++static inline void le32_to_cpu_array(uint32_t *buf, unsigned int words) ++{ ++ while (words--) { ++ *buf = le32_to_cpup(buf); ++ ++buf; ++ } ++} ++ ++static inline uint32_t ror32(uint32_t word, unsigned int shift) ++{ ++ return (word >> (shift & 31)) | (word << ((-shift) & 31)); ++} ++ ++static const uint32_t blake2s_iv[8] = { ++ 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, ++ 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL ++}; ++ ++static const uint8_t blake2s_sigma[10][16] = { ++ { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, ++ { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 }, ++ { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 }, ++ { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 }, ++ { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 }, ++ { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 }, ++ { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 }, ++ { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 }, ++ { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 }, ++ { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0 }, ++}; ++ ++static void blake2s_set_lastblock(struct blake2s_state *state) ++{ ++ state->f[0] = -1; ++} ++ ++static void blake2s_increment_counter(struct blake2s_state *state, const uint32_t inc) ++{ ++ state->t[0] += inc; ++ state->t[1] += (state->t[0] < inc); ++} ++ ++static void blake2s_init_param(struct blake2s_state *state, const uint32_t param) ++{ ++ int i; ++ ++ memset(state, 0, sizeof(*state)); ++ for (i = 0; i < 8; ++i) ++ state->h[i] = blake2s_iv[i]; ++ state->h[0] ^= param; ++} ++ ++static void blake2s_init(struct blake2s_state *state, const size_t outlen) ++{ ++ blake2s_init_param(state, 0x01010000 | outlen); ++ state->outlen = outlen; ++} ++ ++static void blake2s_compress(struct blake2s_state *state, const uint8_t *block, size_t nblocks, const uint32_t inc) ++{ ++ uint32_t m[16]; ++ uint32_t v[16]; ++ int i; ++ ++ while (nblocks > 0) { ++ blake2s_increment_counter(state, inc); ++ memcpy(m, block, BLAKE2S_BLOCK_LEN); ++ le32_to_cpu_array(m, ARRAY_SIZE(m)); ++ memcpy(v, state->h, 32); ++ v[ 8] = blake2s_iv[0]; ++ v[ 9] = blake2s_iv[1]; ++ v[10] = blake2s_iv[2]; ++ v[11] = blake2s_iv[3]; ++ v[12] = blake2s_iv[4] ^ state->t[0]; ++ v[13] = blake2s_iv[5] ^ state->t[1]; ++ v[14] = blake2s_iv[6] ^ state->f[0]; ++ v[15] = blake2s_iv[7] ^ state->f[1]; ++ ++#define G(r, i, a, b, c, d) do { \ ++ a += b + m[blake2s_sigma[r][2 * i + 0]]; \ ++ d = ror32(d ^ a, 16); \ ++ c += d; \ ++ b = ror32(b ^ c, 12); \ ++ a += b + m[blake2s_sigma[r][2 * i + 1]]; \ ++ d = ror32(d ^ a, 8); \ ++ c += d; \ ++ b = ror32(b ^ c, 7); \ ++} while (0) ++ ++#define ROUND(r) do { \ ++ G(r, 0, v[0], v[ 4], v[ 8], v[12]); \ ++ G(r, 1, v[1], v[ 5], v[ 9], v[13]); \ ++ G(r, 2, v[2], v[ 6], v[10], v[14]); \ ++ G(r, 3, v[3], v[ 7], v[11], v[15]); \ ++ G(r, 4, v[0], v[ 5], v[10], v[15]); \ ++ G(r, 5, v[1], v[ 6], v[11], v[12]); \ ++ G(r, 6, v[2], v[ 7], v[ 8], v[13]); \ ++ G(r, 7, v[3], v[ 4], v[ 9], v[14]); \ ++} while (0) ++ ROUND(0); ++ ROUND(1); ++ ROUND(2); ++ ROUND(3); ++ ROUND(4); ++ ROUND(5); ++ ROUND(6); ++ ROUND(7); ++ ROUND(8); ++ ROUND(9); ++ ++#undef G ++#undef ROUND ++ ++ for (i = 0; i < 8; ++i) ++ state->h[i] ^= v[i] ^ v[i + 8]; ++ ++ block += BLAKE2S_BLOCK_LEN; ++ --nblocks; ++ } ++} ++ ++static void blake2s_update(struct blake2s_state *state, const void *inp, size_t inlen) ++{ ++ const size_t fill = BLAKE2S_BLOCK_LEN - state->buflen; ++ const uint8_t *in = inp; ++ ++ if (!inlen) ++ return; ++ if (inlen > fill) { ++ memcpy(state->buf + state->buflen, in, fill); ++ blake2s_compress(state, state->buf, 1, BLAKE2S_BLOCK_LEN); ++ state->buflen = 0; ++ in += fill; ++ inlen -= fill; ++ } ++ if (inlen > BLAKE2S_BLOCK_LEN) { ++ const size_t nblocks = DIV_ROUND_UP(inlen, BLAKE2S_BLOCK_LEN); ++ blake2s_compress(state, in, nblocks - 1, BLAKE2S_BLOCK_LEN); ++ in += BLAKE2S_BLOCK_LEN * (nblocks - 1); ++ inlen -= BLAKE2S_BLOCK_LEN * (nblocks - 1); ++ } ++ memcpy(state->buf + state->buflen, in, inlen); ++ state->buflen += inlen; ++} ++ ++static void blake2s_final(struct blake2s_state *state, uint8_t *out) ++{ ++ blake2s_set_lastblock(state); ++ memset(state->buf + state->buflen, 0, BLAKE2S_BLOCK_LEN - state->buflen); ++ blake2s_compress(state, state->buf, 1, state->buflen); ++ cpu_to_le32_array(state->h, ARRAY_SIZE(state->h)); ++ memcpy(out, state->h, state->outlen); ++} ++ ++static size_t determine_optimal_seed_len(void) ++{ ++ size_t ret = 0; ++ char poolsize_str[11] = { 0 }; ++ int fd = open("/proc/sys/kernel/random/poolsize", O_RDONLY); ++ ++ if (fd < 0 || read(fd, poolsize_str, sizeof(poolsize_str) - 1) < 0) { ++ ewarn("Unable to determine pool size, falling back to %u bits: %s", MIN_SEED_LEN * 8, strerror(errno)); ++ ret = MIN_SEED_LEN; ++ } else ++ ret = DIV_ROUND_UP(strtoul(poolsize_str, NULL, 10), 8); ++ if (fd >= 0) ++ close(fd); ++ if (ret < MIN_SEED_LEN) ++ ret = MIN_SEED_LEN; ++ else if (ret > MAX_SEED_LEN) ++ ret = MAX_SEED_LEN; ++ return ret; ++} ++ ++static int read_new_seed(uint8_t *seed, size_t len, bool *is_creditable) ++{ ++ ssize_t ret; ++ int urandom_fd; ++ ++ *is_creditable = false; ++ ret = getrandom(seed, len, GRND_NONBLOCK); ++ if (ret == (ssize_t)len) { ++ *is_creditable = true; ++ return 0; ++ } ++ if (ret == -1 && errno == ENOSYS) { ++ struct pollfd random_fd = { ++ .fd = open("/dev/random", O_RDONLY), ++ .events = POLLIN ++ }; ++ if (random_fd.fd < 0) ++ return -errno; ++ *is_creditable = poll(&random_fd, 1, 0) == 1; ++ close(random_fd.fd); ++ } else if (getrandom(seed, len, GRND_INSECURE) == (ssize_t)len) ++ return 0; ++ urandom_fd = open("/dev/urandom", O_RDONLY); ++ if (urandom_fd < 0) ++ return -errno; ++ ret = read(urandom_fd, seed, len); ++ if (ret == (ssize_t)len) ++ ret = 0; ++ else ++ ret = -errno ? -errno : -EIO; ++ close(urandom_fd); ++ return ret; ++} ++ ++static int seed_rng(uint8_t *seed, size_t len, bool credit) ++{ ++ struct { ++ int entropy_count; ++ int buf_size; ++ uint8_t buffer[MAX_SEED_LEN]; ++ } req = { ++ .entropy_count = credit ? len * 8 : 0, ++ .buf_size = len ++ }; ++ int random_fd, ret; ++ ++ if (len > sizeof(req.buffer)) ++ return -EFBIG; ++ memcpy(req.buffer, seed, len); ++ ++ random_fd = open("/dev/random", O_RDWR); ++ if (random_fd < 0) ++ return -errno; ++ ret = ioctl(random_fd, RNDADDENTROPY, &req); ++ if (ret) ++ ret = -errno ? -errno : -EIO; ++ close(random_fd); ++ return ret; ++} ++ ++static int seed_from_file_if_exists(const char *filename, bool credit, struct blake2s_state *hash) ++{ ++ uint8_t seed[MAX_SEED_LEN]; ++ ssize_t seed_len; ++ int fd, dfd, ret = 0; ++ ++ fd = open(filename, O_RDONLY); ++ if (fd < 0 && errno == ENOENT) ++ return 0; ++ else if (fd < 0) { ++ ret = -errno; ++ eerror("Unable to open seed file: %s", strerror(errno)); ++ return ret; ++ } ++ dfd = open(SEED_DIR, O_DIRECTORY | O_RDONLY); ++ if (dfd < 0) { ++ ret = -errno; ++ close(fd); ++ eerror("Unable to open seed directory: %s", strerror(errno)); ++ return ret; ++ } ++ seed_len = read(fd, seed, sizeof(seed)); ++ if (seed_len < 0) { ++ ret = -errno; ++ eerror("Unable to read seed file: %s", strerror(errno)); ++ } ++ close(fd); ++ if (ret) { ++ close(dfd); ++ return ret; ++ } ++ if ((unlink(filename) < 0 || fsync(dfd) < 0) && seed_len) { ++ ret = -errno; ++ eerror("Unable to remove seed after reading, so not seeding: %s", strerror(errno)); ++ } ++ close(dfd); ++ if (ret) ++ return ret; ++ if (!seed_len) ++ return 0; ++ ++ blake2s_update(hash, &seed_len, sizeof(seed_len)); ++ blake2s_update(hash, seed, seed_len); ++ ++ einfo("Seeding %zd bits %s crediting", seed_len * 8, credit ? "and" : "without"); ++ ret = seed_rng(seed, seed_len, credit); ++ if (ret < 0) ++ eerror("Unable to seed: %s", strerror(-ret)); ++ return ret; ++} ++ ++static void populate_global_paths(void) ++{ ++ SEED_DIR = getenv("SEEDRNG_SEED_DIR"); ++ if (!SEED_DIR || !*SEED_DIR) ++ SEED_DIR = "/var/lib/seedrng"; ++ LOCK_FILE = getenv("SEEDRNG_LOCK_FILE"); ++ if (!LOCK_FILE || !*LOCK_FILE) ++ LOCK_FILE = "/var/run/seedrng.lock"; ++ xasprintf(&CREDITABLE_SEED, "%s/seed.credit", SEED_DIR); ++ xasprintf(&NON_CREDITABLE_SEED, "%s/seed.no-credit", SEED_DIR); ++} ++ ++int main(int argc _unused, char *argv[] _unused) ++{ ++ static const char seedrng_prefix[] = "SeedRNG v1 Old+New Prefix"; ++ static const char seedrng_failure[] = "SeedRNG v1 No New Seed Failure"; ++ int ret, fd, lock, program_ret = 0; ++ uint8_t new_seed[MAX_SEED_LEN]; ++ size_t new_seed_len; ++ bool new_seed_creditable; ++ struct timespec realtime = { 0 }, boottime = { 0 }; ++ struct blake2s_state hash; ++ ++ umask(0077); ++ if (getuid()) ++ eerrorx("This rc helper program requires root"); ++ ++ populate_global_paths(); ++ blake2s_init(&hash, BLAKE2S_HASH_LEN); ++ blake2s_update(&hash, seedrng_prefix, strlen(seedrng_prefix)); ++ clock_gettime(CLOCK_REALTIME, &realtime); ++ clock_gettime(CLOCK_BOOTTIME, &boottime); ++ blake2s_update(&hash, &realtime, sizeof(realtime)); ++ blake2s_update(&hash, &boottime, sizeof(boottime)); ++ ++ if (mkdir(SEED_DIR, 0700) < 0 && errno != EEXIST) ++ eerrorx("Unable to create \"%s\" directory: %s", SEED_DIR, strerror(errno)); ++ ++ lock = open(LOCK_FILE, O_WRONLY | O_CREAT, 0000); ++ if (lock < 0 || flock(lock, LOCK_EX) < 0) ++ eerrorx("Unable to open lock file: %s", strerror(errno)); ++ ++ ret = seed_from_file_if_exists(NON_CREDITABLE_SEED, false, &hash); ++ if (ret < 0) ++ program_ret |= 1 << 1; ++ ret = seed_from_file_if_exists(CREDITABLE_SEED, !rc_yesno(getenv("SEEDRNG_SKIP_CREDIT")), &hash); ++ if (ret < 0) ++ program_ret |= 1 << 2; ++ ++ new_seed_len = determine_optimal_seed_len(); ++ ret = read_new_seed(new_seed, new_seed_len, &new_seed_creditable); ++ if (ret < 0) { ++ eerror("Unable to read new seed: %s", strerror(-ret)); ++ new_seed_len = BLAKE2S_HASH_LEN; ++ strncpy((char *)new_seed, seedrng_failure, new_seed_len); ++ program_ret |= 1 << 3; ++ } ++ blake2s_update(&hash, &new_seed_len, sizeof(new_seed_len)); ++ blake2s_update(&hash, new_seed, new_seed_len); ++ blake2s_final(&hash, new_seed + new_seed_len - BLAKE2S_HASH_LEN); ++ ++ einfo("Saving %zu bits of %s seed for next boot", new_seed_len * 8, new_seed_creditable ? "creditable" : "non-creditable"); ++ fd = open(NON_CREDITABLE_SEED, O_WRONLY | O_CREAT | O_TRUNC, 0400); ++ if (fd < 0) { ++ eerror("Unable to open seed file for writing: %s", strerror(errno)); ++ program_ret |= 1 << 4; ++ goto out; ++ } ++ if (write(fd, new_seed, new_seed_len) != (ssize_t)new_seed_len || fsync(fd) < 0) { ++ eerror("Unable to write seed file: %s", strerror(errno)); ++ program_ret |= 1 << 5; ++ goto out; ++ } ++ if (new_seed_creditable && rename(NON_CREDITABLE_SEED, CREDITABLE_SEED) < 0) { ++ ewarn("Unable to make new seed creditable: %s", strerror(errno)); ++ program_ret |= 1 << 6; ++ } ++out: ++ close(fd); ++ close(lock); ++ return program_ret; ++} diff --git a/repo/system/openrc/sysctl.initd b/repo/system/openrc/sysctl.initd new file mode 100644 index 0000000..befdb91 --- /dev/null +++ b/repo/system/openrc/sysctl.initd @@ -0,0 +1,87 @@ +#!/sbin/openrc-run + +depend() +{ + after clock + before bootmisc logger + keyword -prefix -systemd-nspawn -vserver +} + +start() +{ + local quiet retval=0 status + ebegin "Configuring kernel parameters" + + yesno $rc_verbose || quiet=-q + + eindent + + for f in /lib/sysctl.d/*.conf \ + /usr/lib/sysctl.d/*.conf; do + + if [ -f /etc/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /etc/sysctl.d/${f##*/}" + continue + fi + + if [ -f /run/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/sysctl.d/${f##*/}" + continue + fi + + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + # Don't change retval= since we expect some package/distro provided + # sysctl configurations to break, so just warn when the user wants + # verbose messages + vewarn "Unable to configure kernel parameters from $f" + fi + fi + done + + for f in /etc/sysctl.d/*.conf; do + + if [ -f /run/sysctl.d/"${f##*/}" ]; then + veinfo "Ignoring $f due to /run/sysctl.d/${f##*/}" + continue + fi + + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from $f" + fi + fi + done + + if [ -f /etc/sysctl.conf ]; then + vebegin "applying /etc/sysctl.conf" + sysctl $quiet -p /etc/sysctl.conf + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from /etc/sysctl.conf" + fi + fi + + for f in /run/sysctl.d/*.conf; do + if [ -f "$f" ]; then + vebegin "applying $f" + sysctl $quiet -p "$f" + status=$? + if [ $status -gt 0 ]; then + retval=$(( $retval + $status )) + eerror "Unable to configure kernel parameters from $f" + fi + fi + done + eoutdent + + eend $retval +} diff --git a/repo/system/openrc/sysfsconf.initd b/repo/system/openrc/sysfsconf.initd new file mode 100644 index 0000000..433e51d --- /dev/null +++ b/repo/system/openrc/sysfsconf.initd @@ -0,0 +1,66 @@ +#!/sbin/openrc-run + +description="Set sysfs variables from /etc/sysfs.conf and /etc/sysfs.d/*.conf" +conffile=/etc/sysfs.conf +confdir=/etc/sysfs.d + +depend() { + need sysfs +} + +setval() { + local value="$1" attrib="$2" + # Some fields need a terminating newline, others + # need the terminating newline to be absent :-( + echo -n "$value" > "$attrib" 2>/dev/null \ + || echo "$value" > "$attrib" +} + +load_conffile() { + local file="$1" + while read line; do + local line=${line%%#*} + local cmd= attrib= value= + set -- $line + if [ $# -eq 0 ]; then + continue + fi + case "$1$3" in + mode=) cmd=chmod + attrib="$2" + value="$4" + ;; + owner=) cmd=chown + attrib="$2" + value="$4" + ;; + *) if [ "$2" = "=" ]; then + cmd=setval + attrib="$1" + value="$3" + fi + ;; + esac + if ! [ -e "/sys/$attrib" ]; then + eerror "$attrib: unknown attribute" + continue + fi + if [ -z "$attrib" ] || [ -z "$value" ]; then + eerror "syntax error in $file: '$line'" + continue + fi + $cmd "$value" "/sys/$attrib" + done < "$file" +} + +start() { + [ -r "$conffile" -o -d "$confdir" ] || return 0 + ebegin "Setting sysfs variables" + for file in $confdir/*.conf $conffile; do + [ -r "$file" ] || continue + load_conffile "$file" || return 1 + done + eend 0 + +} + diff --git a/repo/system/openrc/test-networking.sh b/repo/system/openrc/test-networking.sh new file mode 100644 index 0000000..5e5f70b --- /dev/null +++ b/repo/system/openrc/test-networking.sh @@ -0,0 +1,65 @@ +#!/bin/sh + +# unit tests for find_ifaces and find_running_ifaces in networking.initd + +cfgfile=/tmp/openrc-test-network.$$ +sourcefile=$cfgfile.source +sourcedir=$cfgfile.d +ifstate=$cfgfile.state + +cat >$cfgfile<$sourcefile<$sourcedir/a<$ifstate<month_last_day, '==', 31); # test more + + + SKIP: { +- skip "Extra tests for Linux, BSD only.", 8 unless $is_linux or $is_mac or $is_bsd; ++ skip "Extra tests for Linux, BSD only.", 8 unless $is_mac or $is_bsd; + + local $ENV{TZ} = "EST5EDT4"; + Time::Piece::_tzset(); diff --git a/repo/system/perl/musl-stack-size.patch b/repo/system/perl/musl-stack-size.patch new file mode 100644 index 0000000..08a9ef0 --- /dev/null +++ b/repo/system/perl/musl-stack-size.patch @@ -0,0 +1,16 @@ +Tests fails on s390x due to low thread stack size +upstream report: https://github.com/Perl/perl5/issues/18160 + +diff --git a/t/thread_it.pl b/t/thread_it.pl +index f38a580..e8c450a 100644 +--- a/t/thread_it.pl ++++ b/t/thread_it.pl +@@ -36,7 +36,7 @@ my $curr = threads->create({ + stack_size => $^O eq 'hpux' ? 524288 : + $^O eq 'darwin' ? 2000000: + $^O eq 'VMS' ? 150000 : +- $^O eq 'aix' ? 1500000 : 0, ++ $^O eq 'aix' ? 1500000 : 256*1024, + }, sub { + run_tests(); + return defined &curr_test ? curr_test() : () diff --git a/repo/system/perl/perl.xibuild b/repo/system/perl/perl.xibuild new file mode 100644 index 0000000..494b9f1 --- /dev/null +++ b/repo/system/perl/perl.xibuild @@ -0,0 +1,60 @@ +#!/bin/sh + +MAKEDEPS="make sed" +DEPS="gdbm musl bzip2 zlib tar" + +PKG_VER=5.34.0 +SOURCE=https://www.cpan.org/src/5.0/perl-$PKG_VER.tar.gz +DESC="The Practical Extraction and Report Language" +ADDITIONAL=" +musl-locale.patch +musl-skip-dst-test.patch +musl-stack-size.patch +skip-test-due-to-busybox-ps.patch +zlib-test.patch +" + +prepare () { + apply_patches + export BUILD_ZLIB=False + export BUILD_BZIP2=0 + export CF_OLD=$CFLAGS + export CFLAGS="$CFLAGS -DNO_POSIX_2008_LOCALE" + export CFLAGS="$CFLAGS -D_GNU_SOURCE" + + rm -rf cpan/Compress-Raw-Zlib/zlib-src + sed -i '/\(bzip2\|zlib\)-src/d' MANIFEST + + rm -rf cpan/Compress-Raw-Bzip2/bzip2-src + sed -i '/\(bzip2\|zzz\)-src/d' MANIFEST + + sh Configure -des -Dprefix=/usr \ + -Dvendorprefix=/usr \ + -Dprivlib=/usr/lib/perl5/5.34/core_perl \ + -Darchlib=/usr/lib/perl5/5.34/core_perl \ + -Dsitelib=/usr/lib/perl5/5.34/site_perl \ + -Dsitearch=/usr/lib/perl5/5.34/site_perl \ + -Dvendorlib=/usr/lib/perl5/5.34/vendor_perl \ + -Dvendorarch=/usr/lib/perl5/5.34/vendor_perl \ + -Dman1dir=/usr/share/man/man1 \ + -Dman3dir=/usr/share/man/man3 \ + -Dpager="/usr/bin/less -isR" \ + -Duseshrplib \ + -Dusethreads \ + -Dcccdlflags='-fPIC' -Dccdlflags='-rdynamic' +} + +build () { + make +} + +check () { + make test || true +} + +package () { + make DESTDIR="$PKG_DEST" install + for f in $(find /export -maxdepth 1 -type f); do echo $f; rm $f; done + unset BUILD_ZLIB BUILD_BZIP2 +} + diff --git a/repo/system/perl/skip-test-due-to-busybox-ps.patch b/repo/system/perl/skip-test-due-to-busybox-ps.patch new file mode 100644 index 0000000..ac3becc --- /dev/null +++ b/repo/system/perl/skip-test-due-to-busybox-ps.patch @@ -0,0 +1,13 @@ +diff --git a/t/op/magic.t b/t/op/magic.t +index 27c1d43..91882f4 100644 +--- a/t/op/magic.t ++++ b/t/op/magic.t +@@ -408,7 +408,7 @@ EOP + # argv[0] assignment and by calling prctl() + { + SKIP: { +- skip "We don't have prctl() here, or we're on Android", 2 unless $Config{d_prctl_set_name} && $^O ne 'android'; ++ skip "Skip test to avoid external ps(1) dependency", 2; + + # We don't really need these tests. prctl() is tested in the + # Kernel, but test it anyway for our sanity. If something doesn't diff --git a/repo/system/perl/zlib-test.patch b/repo/system/perl/zlib-test.patch new file mode 100644 index 0000000..1cb8f5e --- /dev/null +++ b/repo/system/perl/zlib-test.patch @@ -0,0 +1,80 @@ +diff --git a/cpan/Compress-Raw-Zlib/t/02zlib.t b/cpan/Compress-Raw-Zlib/t/02zlib.t +index 64c8944..9b2e9cb 100644 +--- a/cpan/Compress-Raw-Zlib/t/02zlib.t ++++ b/cpan/Compress-Raw-Zlib/t/02zlib.t +@@ -13,6 +13,7 @@ use bytes; + use Test::More ; + use CompTestUtils; + ++use constant ZLIB_1_2_12_0 => 0x12C0; + + BEGIN + { +@@ -490,7 +491,16 @@ SKIP: + last if $status == Z_STREAM_END or $status != Z_OK ; + } + +- cmp_ok $status, '==', Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + + +@@ -514,7 +524,17 @@ SKIP: + is length($rest), $len2, "expected compressed output"; + + $GOT = ''; +- cmp_ok $k->inflate($rest, $GOT), '==', Z_DATA_ERROR, "inflate returns Z_DATA_ERROR"; ++ $status = $k->inflate($rest, $GOT); ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + is $GOT, $goodbye ; + } + +diff --git a/cpan/IO-Compress/t/cz-03zlib-v1.t b/cpan/IO-Compress/t/cz-03zlib-v1.t +index 9b75f9b..41734d0 100644 +--- a/cpan/IO-Compress/t/cz-03zlib-v1.t ++++ b/cpan/IO-Compress/t/cz-03zlib-v1.t +@@ -14,6 +14,8 @@ use Test::More ; + use CompTestUtils; + use Symbol; + ++use constant ZLIB_1_2_12_0 => 0x12C0; ++ + BEGIN + { + # use Test::NoWarnings, if available +@@ -700,7 +702,16 @@ EOM + + ($GOT, $status) = $k->inflate($rest) ; + +- ok $status == Z_DATA_ERROR ; ++ # Z_STREAM_END returned by 1.12.2, Z_DATA_ERROR for older zlib ++ if (ZLIB_VERNUM >= ZLIB_1_2_12_0) ++ { ++ cmp_ok $status, '==', Z_STREAM_END ; ++ } ++ else ++ { ++ cmp_ok $status, '==', Z_DATA_ERROR ; ++ } ++ + ok $Z . $GOT eq $goodbye ; + } + diff --git a/repo/system/polkit.xibuild b/repo/system/polkit.xibuild deleted file mode 100644 index eb236bc..0000000 --- a/repo/system/polkit.xibuild +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -MAKEDEPS="git gobject-introspection meson libxslt patch elogind gtk-doc autoconf-archive" -DEPS="expat glib js78 pam" - -PKG_VER=0.120 -SOURCE=https://www.freedesktop.org/software/polkit/releases/polkit-$PKG_VER.tar.gz - -DESC="Application development toolkit for controlling system-wide privileges" - -ADDITIONAL=" - files/polkit-1 - patches/CVE-2021-4034.patch - patches/make-innetgr-optional.patch -" - -prepare () { - apply_patches - - autoreconf -fi -} - -build () { - mkdir build && - cd build && - - ../configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --libexecdir=/usr/lib/polkit-1 \ - --localstatedir=/var \ - --disable-static \ - --enable-introspection \ - --with-authfw=pam \ - --with-os-type=alpine \ - --disable-gtk-doc \ - --disable-gtk-doc-html \ - --disable-gtk-doc-pdf \ - --disable-libelogind \ - --disable-systemd \ - --enable-libsystemd-login - make -} - -package () { - make DESTDIR=$PKG_DEST install && - cd .. && - install -m644 polkit-1 $PKG_DEST/etc/pam.d/polkit-1 -} - -postinstall() { - /usr/sbin/groupadd -fg 27 polkitd && - /usr/sbin/useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \ - -g polkitd -s /bin/false polkitd - true -} diff --git a/repo/system/polkit/files/polkit-1 b/repo/system/polkit/files/polkit-1 new file mode 100644 index 0000000..df1b69a --- /dev/null +++ b/repo/system/polkit/files/polkit-1 @@ -0,0 +1,9 @@ +# Begin /etc/pam.d/polkit-1 + +auth include system-auth +account include system-account +password include system-password +session include system-session + +# End /etc/pam.d/polkit-1 + diff --git a/repo/system/polkit/patches/CVE-2021-4034.patch b/repo/system/polkit/patches/CVE-2021-4034.patch new file mode 100644 index 0000000..a06300a --- /dev/null +++ b/repo/system/polkit/patches/CVE-2021-4034.patch @@ -0,0 +1,79 @@ +From a2bf5c9c83b6ae46cbd5c779d3055bff81ded683 Mon Sep 17 00:00:00 2001 +From: Jan Rybar +Date: Tue, 25 Jan 2022 17:21:46 +0000 +Subject: [PATCH] pkexec: local privilege escalation (CVE-2021-4034) + +--- + src/programs/pkcheck.c | 5 +++++ + src/programs/pkexec.c | 23 ++++++++++++++++++++--- + 2 files changed, 25 insertions(+), 3 deletions(-) + +diff --git a/src/programs/pkcheck.c b/src/programs/pkcheck.c +index f1bb4e1..768525c 100644 +--- a/src/programs/pkcheck.c ++++ b/src/programs/pkcheck.c +@@ -363,6 +363,11 @@ main (int argc, char *argv[]) + local_agent_handle = NULL; + ret = 126; + ++ if (argc < 1) ++ { ++ exit(126); ++ } ++ + /* Disable remote file access from GIO. */ + setenv ("GIO_USE_VFS", "local", 1); + +diff --git a/src/programs/pkexec.c b/src/programs/pkexec.c +index 7698c5c..84e5ef6 100644 +--- a/src/programs/pkexec.c ++++ b/src/programs/pkexec.c +@@ -488,6 +488,15 @@ main (int argc, char *argv[]) + pid_t pid_of_caller; + gpointer local_agent_handle; + ++ ++ /* ++ * If 'pkexec' is called THIS wrong, someone's probably evil-doing. Don't be nice, just bail out. ++ */ ++ if (argc<1) ++ { ++ exit(127); ++ } ++ + ret = 127; + authority = NULL; + subject = NULL; +@@ -614,10 +623,10 @@ main (int argc, char *argv[]) + + path = g_strdup (pwstruct.pw_shell); + if (!path) +- { ++ { + g_printerr ("No shell configured or error retrieving pw_shell\n"); + goto out; +- } ++ } + /* If you change this, be sure to change the if (!command_line) + case below too */ + command_line = g_strdup (path); +@@ -636,7 +645,15 @@ main (int argc, char *argv[]) + goto out; + } + g_free (path); +- argv[n] = path = s; ++ path = s; ++ ++ /* argc<2 and pkexec runs just shell, argv is guaranteed to be null-terminated. ++ * /-less shell shouldn't happen, but let's be defensive and don't write to null-termination ++ */ ++ if (argv[n] != NULL) ++ { ++ argv[n] = path; ++ } + } + if (access (path, F_OK) != 0) + { +-- +GitLab + diff --git a/repo/system/polkit/patches/make-innetgr-optional.patch b/repo/system/polkit/patches/make-innetgr-optional.patch new file mode 100644 index 0000000..8459c67 --- /dev/null +++ b/repo/system/polkit/patches/make-innetgr-optional.patch @@ -0,0 +1,239 @@ +See https://gitlab.freedesktop.org/polkit/polkit/merge_requests/10 + +From 778bb45e0e0cbabe2b04adf67a500af1dab09768 Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +Date: Wed, 11 Jul 2018 04:54:26 -0500 +Subject: [PATCH] make netgroup support optional + +On at least Linux/musl and Linux/uclibc, netgroup support is not +available. PolKit fails to compile on these systems for that reason. + +This change makes netgroup support conditional on the presence of the +setnetgrent(3) function which is required for the support to work. If +that function is not available on the system, an error will be returned +to the administrator if unix-netgroup: is specified in configuration. + +Fixes bug 50145. + +Closes polkit/polkit#14. + +Signed-off-by: A. Wilcox +--- +diff --git a/configure.ac b/configure.ac +index 4ac2219..ca478df 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -100,7 +100,7 @@ AC_CHECK_LIB(expat,XML_ParserCreate,[EXPAT_LIBS="-lexpat"], + [AC_MSG_ERROR([Can't find expat library. Please install expat.])]) + AC_SUBST(EXPAT_LIBS) + +-AC_CHECK_FUNCS(clearenv fdatasync) ++AC_CHECK_FUNCS(clearenv fdatasync setnetgrent) + + if test "x$GCC" = "xyes"; then + LDFLAGS="-Wl,--as-needed $LDFLAGS" +diff --git a/src/polkit/polkitidentity.c b/src/polkit/polkitidentity.c +index 3aa1f7f..10e9c17 100644 +--- a/src/polkit/polkitidentity.c ++++ b/src/polkit/polkitidentity.c +@@ -182,7 +182,15 @@ polkit_identity_from_string (const gchar *str, + } + else if (g_str_has_prefix (str, "unix-netgroup:")) + { ++#ifndef HAVE_SETNETGRENT ++ g_set_error (error, ++ POLKIT_ERROR, ++ POLKIT_ERROR_FAILED, ++ "Netgroups are not available on this machine ('%s')", ++ str); ++#else + identity = polkit_unix_netgroup_new (str + sizeof "unix-netgroup:" - 1); ++#endif + } + + if (identity == NULL && (error != NULL && *error == NULL)) +@@ -344,6 +352,13 @@ polkit_identity_new_for_gvariant (GVariant *variant, + GVariant *v; + const char *name; + ++#ifndef HAVE_SETNETGRENT ++ g_set_error (error, ++ POLKIT_ERROR, ++ POLKIT_ERROR_FAILED, ++ "Netgroups are not available on this machine"); ++ goto out; ++#else + v = lookup_asv (details_gvariant, "name", G_VARIANT_TYPE_STRING, error); + if (v == NULL) + { +@@ -353,6 +368,7 @@ polkit_identity_new_for_gvariant (GVariant *variant, + name = g_variant_get_string (v, NULL); + ret = polkit_unix_netgroup_new (name); + g_variant_unref (v); ++#endif + } + else + { +diff --git a/src/polkit/polkitunixnetgroup.c b/src/polkit/polkitunixnetgroup.c +index 8a2b369..83f8d4a 100644 +--- a/src/polkit/polkitunixnetgroup.c ++++ b/src/polkit/polkitunixnetgroup.c +@@ -194,6 +194,9 @@ polkit_unix_netgroup_set_name (PolkitUnixNetgroup *group, + PolkitIdentity * + polkit_unix_netgroup_new (const gchar *name) + { ++#ifndef HAVE_SETNETGRENT ++ g_assert_not_reached(); ++#endif + g_return_val_if_fail (name != NULL, NULL); + return POLKIT_IDENTITY (g_object_new (POLKIT_TYPE_UNIX_NETGROUP, + "name", name, +diff --git a/src/polkitbackend/polkitbackendinteractiveauthority.c b/src/polkitbackend/polkitbackendinteractiveauthority.c +index 056d9a8..36c2f3d 100644 +--- a/src/polkitbackend/polkitbackendinteractiveauthority.c ++++ b/src/polkitbackend/polkitbackendinteractiveauthority.c +@@ -2233,25 +2233,26 @@ get_users_in_net_group (PolkitIdentity *group, + GList *ret; + + ret = NULL; ++#ifdef HAVE_SETNETGRENT + name = polkit_unix_netgroup_get_name (POLKIT_UNIX_NETGROUP (group)); + +-#ifdef HAVE_SETNETGRENT_RETURN ++# ifdef HAVE_SETNETGRENT_RETURN + if (setnetgrent (name) == 0) + { + g_warning ("Error looking up net group with name %s: %s", name, g_strerror (errno)); + goto out; + } +-#else ++# else + setnetgrent (name); +-#endif ++# endif /* HAVE_SETNETGRENT_RETURN */ + + for (;;) + { +-#if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) ++# if defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) + const char *hostname, *username, *domainname; +-#else ++# else + char *hostname, *username, *domainname; +-#endif ++# endif /* defined(HAVE_NETBSD) || defined(HAVE_OPENBSD) */ + PolkitIdentity *user; + GError *error = NULL; + +@@ -2282,6 +2283,7 @@ get_users_in_net_group (PolkitIdentity *group, + + out: + endnetgrent (); ++#endif /* HAVE_SETNETGRENT */ + return ret; + } + +diff --git a/src/polkitbackend/polkitbackendjsauthority.cpp b/src/polkitbackend/polkitbackendjsauthority.cpp +index ca17108..da95180 100644 +--- a/src/polkitbackend/polkitbackendjsauthority.cpp ++++ b/src/polkitbackend/polkitbackendjsauthority.cpp +@@ -1520,6 +1520,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, + + JS::CallArgs args = JS::CallArgsFromVp (argc, vp); + ++#ifdef HAVE_SETNETGRENT + JS::RootedString usrstr (authority->priv->cx); + usrstr = args[0].toString(); + user = JS_EncodeStringToUTF8 (cx, usrstr); +@@ -1534,6 +1535,7 @@ js_polkit_user_is_in_netgroup (JSContext *cx, + { + is_in_netgroup = true; + } ++ #endif + + ret = true; + +diff --git a/test/polkit/polkitidentitytest.c b/test/polkit/polkitidentitytest.c +index e91967b..e829aaa 100644 +--- a/test/polkit/polkitidentitytest.c ++++ b/test/polkit/polkitidentitytest.c +@@ -19,6 +19,7 @@ + * Author: Nikki VonHollen + */ + ++#include "config.h" + #include "glib.h" + #include + #include +@@ -145,11 +146,15 @@ struct ComparisonTestData comparison_test_data [] = { + {"unix-group:root", "unix-group:jane", FALSE}, + {"unix-group:jane", "unix-group:jane", TRUE}, + ++#ifdef HAVE_SETNETGRENT + {"unix-netgroup:foo", "unix-netgroup:foo", TRUE}, + {"unix-netgroup:foo", "unix-netgroup:bar", FALSE}, ++#endif + + {"unix-user:root", "unix-group:root", FALSE}, ++#ifdef HAVE_SETNETGRENT + {"unix-user:jane", "unix-netgroup:foo", FALSE}, ++#endif + + {NULL}, + }; +@@ -181,11 +186,13 @@ main (int argc, char *argv[]) + g_test_add_data_func ("/PolkitIdentity/group_string_2", "unix-group:jane", test_string); + g_test_add_data_func ("/PolkitIdentity/group_string_3", "unix-group:users", test_string); + ++#ifdef HAVE_SETNETGRENT + g_test_add_data_func ("/PolkitIdentity/netgroup_string", "unix-netgroup:foo", test_string); ++ g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant); ++#endif + + g_test_add_data_func ("/PolkitIdentity/user_gvariant", "unix-user:root", test_gvariant); + g_test_add_data_func ("/PolkitIdentity/group_gvariant", "unix-group:root", test_gvariant); +- g_test_add_data_func ("/PolkitIdentity/netgroup_gvariant", "unix-netgroup:foo", test_gvariant); + + add_comparison_tests (); + +diff --git a/test/polkit/polkitunixnetgrouptest.c b/test/polkit/polkitunixnetgrouptest.c +index 3701ba1..e3352eb 100644 +--- a/test/polkit/polkitunixnetgrouptest.c ++++ b/test/polkit/polkitunixnetgrouptest.c +@@ -19,6 +19,7 @@ + * Author: Nikki VonHollen + */ + ++#include "config.h" + #include "glib.h" + #include + #include +@@ -69,7 +70,9 @@ int + main (int argc, char *argv[]) + { + g_test_init (&argc, &argv, NULL); ++#ifdef HAVE_SETNETGRENT + g_test_add_func ("/PolkitUnixNetgroup/new", test_new); + g_test_add_func ("/PolkitUnixNetgroup/set_name", test_set_name); ++#endif + return g_test_run (); + } +diff --git a/test/polkitbackend/test-polkitbackendjsauthority.c b/test/polkitbackend/test-polkitbackendjsauthority.c +index f97e0e0..fc52149 100644 +--- a/test/polkitbackend/test-polkitbackendjsauthority.c ++++ b/test/polkitbackend/test-polkitbackendjsauthority.c +@@ -137,12 +137,14 @@ test_get_admin_identities (void) + "unix-group:users" + } + }, ++#ifdef HAVE_SETNETGRENT + { + "net.company.action3", + { + "unix-netgroup:foo" + } + }, ++#endif + }; + guint n; + diff --git a/repo/system/polkit/polkit.xibuild b/repo/system/polkit/polkit.xibuild new file mode 100644 index 0000000..eb236bc --- /dev/null +++ b/repo/system/polkit/polkit.xibuild @@ -0,0 +1,58 @@ +#!/bin/sh + +MAKEDEPS="git gobject-introspection meson libxslt patch elogind gtk-doc autoconf-archive" +DEPS="expat glib js78 pam" + +PKG_VER=0.120 +SOURCE=https://www.freedesktop.org/software/polkit/releases/polkit-$PKG_VER.tar.gz + +DESC="Application development toolkit for controlling system-wide privileges" + +ADDITIONAL=" + files/polkit-1 + patches/CVE-2021-4034.patch + patches/make-innetgr-optional.patch +" + +prepare () { + apply_patches + + autoreconf -fi +} + +build () { + mkdir build && + cd build && + + ../configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info \ + --libexecdir=/usr/lib/polkit-1 \ + --localstatedir=/var \ + --disable-static \ + --enable-introspection \ + --with-authfw=pam \ + --with-os-type=alpine \ + --disable-gtk-doc \ + --disable-gtk-doc-html \ + --disable-gtk-doc-pdf \ + --disable-libelogind \ + --disable-systemd \ + --enable-libsystemd-login + make +} + +package () { + make DESTDIR=$PKG_DEST install && + cd .. && + install -m644 polkit-1 $PKG_DEST/etc/pam.d/polkit-1 +} + +postinstall() { + /usr/sbin/groupadd -fg 27 polkitd && + /usr/sbin/useradd -c "PolicyKit Daemon Owner" -d /etc/polkit-1 -u 27 \ + -g polkitd -s /bin/false polkitd + true +} diff --git a/repo/system/popt.xibuild b/repo/system/popt.xibuild deleted file mode 100644 index 31796a7..0000000 --- a/repo/system/popt.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.18 -SOURCE=http://ftp.rpm.org/popt/releases/popt-1.x/popt-$PKG_VER.tar.gz -DESC="Libraries for parsing command line options" - -build () { - ./configure --prefix=/usr --disable-static && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/popt/popt.xibuild b/repo/system/popt/popt.xibuild new file mode 100644 index 0000000..31796a7 --- /dev/null +++ b/repo/system/popt/popt.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.18 +SOURCE=http://ftp.rpm.org/popt/releases/popt-1.x/popt-$PKG_VER.tar.gz +DESC="Libraries for parsing command line options" + +build () { + ./configure --prefix=/usr --disable-static && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/psmisc.xibuild b/repo/system/psmisc.xibuild deleted file mode 100644 index 61d767f..0000000 --- a/repo/system/psmisc.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make gettext-tiny libintl" -DEPS="ncurses" - -PKG_VER=23.4 -SOURCE=https://downloads.sourceforge.net/psmisc/psmisc-$PKG_VER.tar.xz -DESC="Miscellaneous procfs tools" - -build () { - ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/psmisc/psmisc.xibuild b/repo/system/psmisc/psmisc.xibuild new file mode 100644 index 0000000..61d767f --- /dev/null +++ b/repo/system/psmisc/psmisc.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make gettext-tiny libintl" +DEPS="ncurses" + +PKG_VER=23.4 +SOURCE=https://downloads.sourceforge.net/psmisc/psmisc-$PKG_VER.tar.xz +DESC="Miscellaneous procfs tools" + +build () { + ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/queue-standalone.xibuild b/repo/system/queue-standalone.xibuild deleted file mode 100644 index c58dec8..0000000 --- a/repo/system/queue-standalone.xibuild +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="" - -DESC="The queue.h header from glibc" - -ADDITIONAL=" - https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/queue-standalone/files/queue.h -" - -package () { - install -d $PKG_DEST/usr/include/sys/ - install -m644 queue.h $PKG_DEST/usr/include/sys/ -} diff --git a/repo/system/queue-standalone/queue-standalone.xibuild b/repo/system/queue-standalone/queue-standalone.xibuild new file mode 100644 index 0000000..c58dec8 --- /dev/null +++ b/repo/system/queue-standalone/queue-standalone.xibuild @@ -0,0 +1,15 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="" + +DESC="The queue.h header from glibc" + +ADDITIONAL=" + https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/queue-standalone/files/queue.h +" + +package () { + install -d $PKG_DEST/usr/include/sys/ + install -m644 queue.h $PKG_DEST/usr/include/sys/ +} diff --git a/repo/system/re2.xibuild b/repo/system/re2.xibuild deleted file mode 100644 index 4dd0e5d..0000000 --- a/repo/system/re2.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -NAME="re2" -DESC="Efficient, principled regular expression library" - -MAKEDEPS="make " -DEPS="musl " - -PKG_VER=2022.04.01 -SOURCE="https://github.com/google/re2/archive/$(echo $PKG_VER | sed "s/\./-/g").tar.gz" - -build () { - make PREFIX=/usr -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install -} diff --git a/repo/system/re2/re2.xibuild b/repo/system/re2/re2.xibuild new file mode 100644 index 0000000..4dd0e5d --- /dev/null +++ b/repo/system/re2/re2.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +NAME="re2" +DESC="Efficient, principled regular expression library" + +MAKEDEPS="make " +DEPS="musl " + +PKG_VER=2022.04.01 +SOURCE="https://github.com/google/re2/archive/$(echo $PKG_VER | sed "s/\./-/g").tar.gz" + +build () { + make PREFIX=/usr +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install +} diff --git a/repo/system/readline.xibuild b/repo/system/readline.xibuild deleted file mode 100644 index 5b93318..0000000 --- a/repo/system/readline.xibuild +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make sed" -DEPS="musl ncurses" - -PKG_VER=8.1 - -SOURCE=https://ftp.gnu.org/gnu/readline/readline-$PKG_VER.tar.gz -DESC="a set of libraries that offer command line editing and history capabilities" - - -prepare () { - sed -i '/MV.*old/d' Makefile.in - sed -i '/{OLDSUFF}/c:' support/shlib-install -} - -build () { - ./configure --prefix=/usr \ - --disable-static \ - --with-curses \ - --docdir=/usr/share/doc/readline-$PKG_VER - - make SHLIB_LIBS="-lncursesw" -} - -package () { - make SHLIB_LIBS="-lncursesw" DESTDIR=$PKG_DEST install - install -m644 doc/* $PKG_DEST/usr/share/doc/readline-$PKG_VER -} - diff --git a/repo/system/readline/readline.xibuild b/repo/system/readline/readline.xibuild new file mode 100644 index 0000000..5b93318 --- /dev/null +++ b/repo/system/readline/readline.xibuild @@ -0,0 +1,30 @@ +#!/bin/sh + +MAKEDEPS="make sed" +DEPS="musl ncurses" + +PKG_VER=8.1 + +SOURCE=https://ftp.gnu.org/gnu/readline/readline-$PKG_VER.tar.gz +DESC="a set of libraries that offer command line editing and history capabilities" + + +prepare () { + sed -i '/MV.*old/d' Makefile.in + sed -i '/{OLDSUFF}/c:' support/shlib-install +} + +build () { + ./configure --prefix=/usr \ + --disable-static \ + --with-curses \ + --docdir=/usr/share/doc/readline-$PKG_VER + + make SHLIB_LIBS="-lncursesw" +} + +package () { + make SHLIB_LIBS="-lncursesw" DESTDIR=$PKG_DEST install + install -m644 doc/* $PKG_DEST/usr/share/doc/readline-$PKG_VER +} + diff --git a/repo/system/rtmpdump.xibuild b/repo/system/rtmpdump.xibuild deleted file mode 100644 index cac7356..0000000 --- a/repo/system/rtmpdump.xibuild +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl gnutls zlib" - -SOURCE=git://git.ffmpeg.org/rtmpdump -BRANCH="fa8646d" -DESC="Tool to download rtmp streams" - -prepare () { - sed -e 's/^CRYPTO=OPENSSL/#CRYPTO=OPENSSL/' -e 's/#CRYPTO=GNUTLS/CRYPTO=GNUTLS/' -i Makefile -i librtmp/Makefile - -} - -build () { - make SYS=posix -} - -package () { - mkdir -p $PKG_DEST/usr/bin - mkdir -p $PKG_DEST/usr/share - mkdir -p $PKG_DEST/usr/lib/pkgconfig - make \ - prefix='/usr' \ - sbindir='/usr/bin' \ - mandir='/usr/share/man' \ - DESTDIR=$PKG_DEST install -} diff --git a/repo/system/rtmpdump/rtmpdump.xibuild b/repo/system/rtmpdump/rtmpdump.xibuild new file mode 100644 index 0000000..cac7356 --- /dev/null +++ b/repo/system/rtmpdump/rtmpdump.xibuild @@ -0,0 +1,28 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl gnutls zlib" + +SOURCE=git://git.ffmpeg.org/rtmpdump +BRANCH="fa8646d" +DESC="Tool to download rtmp streams" + +prepare () { + sed -e 's/^CRYPTO=OPENSSL/#CRYPTO=OPENSSL/' -e 's/#CRYPTO=GNUTLS/CRYPTO=GNUTLS/' -i Makefile -i librtmp/Makefile + +} + +build () { + make SYS=posix +} + +package () { + mkdir -p $PKG_DEST/usr/bin + mkdir -p $PKG_DEST/usr/share + mkdir -p $PKG_DEST/usr/lib/pkgconfig + make \ + prefix='/usr' \ + sbindir='/usr/bin' \ + mandir='/usr/share/man' \ + DESTDIR=$PKG_DEST install +} diff --git a/repo/system/sbase.xibuild b/repo/system/sbase.xibuild deleted file mode 100644 index a380c9e..0000000 --- a/repo/system/sbase.xibuild +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl acl attr gmp ubase" - -SOURCE=https://git.suckless.org/sbase -ADDITIONAL=" - https://gitea.linfan.moe/mirror/ataraxia/raw/commit/74914d05c701919fe6aa0d63e131df8c4df420fe/stuff/sbase/realpath.1 - https://gitea.linfan.moe/mirror/ataraxia/raw/commit/74914d05c701919fe6aa0d63e131df8c4df420fe/stuff/sbase/realpath.c -" - -DESC="sbase from suckless.org" - -prepare () { - # add uname -o since some packages need it - - sed -i "39i case 'o':" uname.c - sed -i "40i sflag = 1;" uname.c - sed -i "41i break;" uname.c - - sed -i '182i realpath\\' Makefile -} - -build () { - make -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install - - # these are provided by other utils - for p in tar sed find xargs grep sort flock; do - mv $PKG_DEST/usr/bin/$p $PKG_DEST/usr/bin/s$p - mv $PKG_DEST/usr/share/man/man1/$p.1 $PKG_DEST/usr/share/man/man1/s$p.1 - done -} diff --git a/repo/system/sbase/sbase.xibuild b/repo/system/sbase/sbase.xibuild new file mode 100644 index 0000000..a380c9e --- /dev/null +++ b/repo/system/sbase/sbase.xibuild @@ -0,0 +1,36 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl acl attr gmp ubase" + +SOURCE=https://git.suckless.org/sbase +ADDITIONAL=" + https://gitea.linfan.moe/mirror/ataraxia/raw/commit/74914d05c701919fe6aa0d63e131df8c4df420fe/stuff/sbase/realpath.1 + https://gitea.linfan.moe/mirror/ataraxia/raw/commit/74914d05c701919fe6aa0d63e131df8c4df420fe/stuff/sbase/realpath.c +" + +DESC="sbase from suckless.org" + +prepare () { + # add uname -o since some packages need it + + sed -i "39i case 'o':" uname.c + sed -i "40i sflag = 1;" uname.c + sed -i "41i break;" uname.c + + sed -i '182i realpath\\' Makefile +} + +build () { + make +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install + + # these are provided by other utils + for p in tar sed find xargs grep sort flock; do + mv $PKG_DEST/usr/bin/$p $PKG_DEST/usr/bin/s$p + mv $PKG_DEST/usr/share/man/man1/$p.1 $PKG_DEST/usr/share/man/man1/s$p.1 + done +} diff --git a/repo/system/sed.xibuild b/repo/system/sed.xibuild deleted file mode 100644 index ddb7102..0000000 --- a/repo/system/sed.xibuild +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make sort" -DEPS="musl acl attr" - -PKG_VER=0.8.6 -SOURCE=http://landley.net/toybox/downloads/toybox-$PKG_VER.tar.gz -DESC="stream editor from toybox" - -build () { - ./configure - make sed -} - -package () { - install -Dm755 sed $PKG_DEST/usr/bin/ -} diff --git a/repo/system/sed/sed.xibuild b/repo/system/sed/sed.xibuild new file mode 100644 index 0000000..ddb7102 --- /dev/null +++ b/repo/system/sed/sed.xibuild @@ -0,0 +1,17 @@ +#!/bin/sh + +MAKEDEPS="make sort" +DEPS="musl acl attr" + +PKG_VER=0.8.6 +SOURCE=http://landley.net/toybox/downloads/toybox-$PKG_VER.tar.gz +DESC="stream editor from toybox" + +build () { + ./configure + make sed +} + +package () { + install -Dm755 sed $PKG_DEST/usr/bin/ +} diff --git a/repo/system/sh.xibuild b/repo/system/sh.xibuild deleted file mode 100644 index db37812..0000000 --- a/repo/system/sh.xibuild +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -DEPS="dash" -MAKEDEPS="" - -DESC="The system shell" - diff --git a/repo/system/sh/sh.xibuild b/repo/system/sh/sh.xibuild new file mode 100644 index 0000000..db37812 --- /dev/null +++ b/repo/system/sh/sh.xibuild @@ -0,0 +1,6 @@ +#!/bin/sh +DEPS="dash" +MAKEDEPS="" + +DESC="The system shell" + diff --git a/repo/system/shadow.xibuild b/repo/system/shadow.xibuild deleted file mode 100644 index 22bd2f1..0000000 --- a/repo/system/shadow.xibuild +++ /dev/null @@ -1,136 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="acl libcap libxcrypt" - -PKG_VER=4.11.1 - -SOURCE=https://github.com/shadow-maint/shadow/releases/download/v$PKG_VER/shadow-$PKG_VER.tar.xz -DESC="Password and account management tool suite with support for shadow files and PAM" -ADDITIONAL=" - chage.pamd - chpasswd.pamd - login.pamd - newusers.pamd - passwd.pamd - su.pamd -" - -prepare () { - - sed -i 's/groups$(EXEEXT) //' src/Makefile.in - find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; - find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; - find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; - - sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \ - -e 's:/var/spool/mail:/var/mail:' \ - -e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \ - -i etc/login.defs - - mkdir -p $PKG_DEST/usr/bin - touch $PKG_DEST/usr/bin/passwd - -} - -build () { - ./configure \ - --prefix=/usr \ - --sysconfdir=/etc \ - --mandir=/usr/share/man \ - --localstatedir=/var \ - --disable-account-tools-setuid \ - --disable-nls \ - --without-audit \ - --with-libpam \ - --without-selinux \ - --without-acl \ - --without-attr \ - --without-tcb \ - --with-yescrypt \ - --without-nscd \ - --without-group-name-max-length \ - --with-fcaps - - make -} - -package () { - make exec_prefix=/usr DESTDIR=$PKG_DEST install - make DESTDIR=$PKG_DEST -C man install-man - mkdir -p $PKG_DEST/etc/default - - [ -d $PKG_DEST/etc/pam.d ] && rm -rf $PKG_DEST/etc/pam.d/* - - - install -m644 $PKG_DEST/etc/login.defs $PKG_DEST/etc/login.defs.orig && - echo "USERGROUPS_ENAB yes"> $PKG_DEST/etc/login.defs - - for f in $ADDITIONAL; do - case $f in - *.pamd) - cp $f $PKG_DEST/etc/pam.d/${f%.pamd} - ;; - esac - done - cp $PKG_DEST/etc/pam.d/su $PKG_DEST/etc/pam.d/su-l - - for PROGRAM in chfn chgpasswd chsh groupadd groupdel \ - groupmems groupmod useradd userdel usermod - do - install -m644 chage.pamd $PKG_DEST/etc/pam.d/${PROGRAM} - sed -i "s/chage/$PROGRAM/" $PKG_DEST/etc/pam.d/${PROGRAM} - done - - [ -f $PKG_DEST/etc/login.access ] && mv $PKG_DEST/etc/login.access $PKG_DEST/etc/login.access.NOUSE || true - [ -f $PKG_DEST/etc/limits ] && mv $PKG_DEST/etc/limits $PKG_DEST/etc/limits.NOUSE || true - - rm $PKG_DEST/usr/bin/su -} - -postinstall () { - - [ ! -f /etc/passwd ] && - cat > /etc/passwd << "EOF" -root:x:0:0:root:/root:/bin/bash -bin:x:1:1:bin:/dev/null:/usr/bin/false -daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false -messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false -uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false -nobody:x:99:99:Unprivileged User:/dev/null:/usr/bin/false -EOF - - [ ! -f /etc/group ] && - cat > /etc/group << "EOF" -root:x:0:root -bin:x:1:daemon -sys:x:2: -kmem:x:3: -tape:x:4: -tty:x:5: -daemon:x:6: -floppy:x:7: -disk:x:8: -lp:x:9: -dialout:x:10: -audio:x:11: -video:x:12: -utmp:x:13: -usb:x:14: -cdrom:x:15: -adm:x:16: -messagebus:x:18: -input:x:24: -mail:x:34: -kvm:x:61: -uuidd:x:80: -wheel:x:97: -nogroup:x:99: -users:x:999: -EOF - /usr/sbin/pwconv - /usr/sbin/grpconv - chmod 0640 /etc/shadow - mkdir -p /etc/default - /usr/sbin/useradd -D --gid 999 -} diff --git a/repo/system/shadow/chage.pamd b/repo/system/shadow/chage.pamd new file mode 100644 index 0000000..3f277f8 --- /dev/null +++ b/repo/system/shadow/chage.pamd @@ -0,0 +1,11 @@ +# Begin /etc/pam.d/chage + +# always allow root +auth sufficient pam_rootok.so + +# include system auth and account settings +auth include system-auth +account include system-account + +# End /etc/pam.d/chage + diff --git a/repo/system/shadow/chpasswd.pamd b/repo/system/shadow/chpasswd.pamd new file mode 100644 index 0000000..81afbee --- /dev/null +++ b/repo/system/shadow/chpasswd.pamd @@ -0,0 +1,12 @@ +# Begin /etc/pam.d/newusers + +# always allow root +auth sufficient pam_rootok.so + +# include system auth and account settings +auth include system-auth +account include system-account +password include system-password + +# End /etc/pam.d/newusers + diff --git a/repo/system/shadow/login.pamd b/repo/system/shadow/login.pamd new file mode 100644 index 0000000..c6410c1 --- /dev/null +++ b/repo/system/shadow/login.pamd @@ -0,0 +1,46 @@ +# Begin /etc/pam.d/login + +# Set failure delay before next prompt to 3 seconds +auth optional pam_faildelay.so delay=3000000 + +# Check to make sure that the user is allowed to login +auth requisite pam_nologin.so + +# Check to make sure that root is allowed to login +# Disabled by default. You will need to create /etc/securetty +# file for this module to function. See man 5 securetty. +#auth required pam_securetty.so + +# Additional group memberships - disabled by default +#auth optional pam_group.so + +# include system auth settings +auth include system-auth + +# check access for the user +account required pam_access.so + +# include system account settings +account include system-account + +# Set default environment variables for the user +session required pam_env.so + +# Set resource limits for the user +session required pam_limits.so + +# Display date of last login - Disabled by default +#session optional pam_lastlog.so + +# Display the message of the day - Disabled by default +#session optional pam_motd.so + +# Check user's mail - Disabled by default +#session optional pam_mail.so standard quiet + +# include system session and password settings +session include system-session +password include system-password + +# End /etc/pam.d/login + diff --git a/repo/system/shadow/newusers.pamd b/repo/system/shadow/newusers.pamd new file mode 100644 index 0000000..57f5cfa --- /dev/null +++ b/repo/system/shadow/newusers.pamd @@ -0,0 +1,12 @@ +# Begin /etc/pam.d/chpasswd + +# always allow root +auth sufficient pam_rootok.so + +# include system auth and account settings +auth include system-auth +account include system-account +password include system-password + +# End /etc/pam.d/chpasswd + diff --git a/repo/system/shadow/passwd.pamd b/repo/system/shadow/passwd.pamd new file mode 100644 index 0000000..83459e3 --- /dev/null +++ b/repo/system/shadow/passwd.pamd @@ -0,0 +1,6 @@ +# Begin /etc/pam.d/passwd + +password include system-password + +# End /etc/pam.d/passwd + diff --git a/repo/system/shadow/shadow.xibuild b/repo/system/shadow/shadow.xibuild new file mode 100644 index 0000000..22bd2f1 --- /dev/null +++ b/repo/system/shadow/shadow.xibuild @@ -0,0 +1,136 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="acl libcap libxcrypt" + +PKG_VER=4.11.1 + +SOURCE=https://github.com/shadow-maint/shadow/releases/download/v$PKG_VER/shadow-$PKG_VER.tar.xz +DESC="Password and account management tool suite with support for shadow files and PAM" +ADDITIONAL=" + chage.pamd + chpasswd.pamd + login.pamd + newusers.pamd + passwd.pamd + su.pamd +" + +prepare () { + + sed -i 's/groups$(EXEEXT) //' src/Makefile.in + find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; + find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; + find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; + + sed -e 's:#ENCRYPT_METHOD DES:ENCRYPT_METHOD SHA512:' \ + -e 's:/var/spool/mail:/var/mail:' \ + -e '/PATH=/{s@/sbin:@@;s@/bin:@@}' \ + -i etc/login.defs + + mkdir -p $PKG_DEST/usr/bin + touch $PKG_DEST/usr/bin/passwd + +} + +build () { + ./configure \ + --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --localstatedir=/var \ + --disable-account-tools-setuid \ + --disable-nls \ + --without-audit \ + --with-libpam \ + --without-selinux \ + --without-acl \ + --without-attr \ + --without-tcb \ + --with-yescrypt \ + --without-nscd \ + --without-group-name-max-length \ + --with-fcaps + + make +} + +package () { + make exec_prefix=/usr DESTDIR=$PKG_DEST install + make DESTDIR=$PKG_DEST -C man install-man + mkdir -p $PKG_DEST/etc/default + + [ -d $PKG_DEST/etc/pam.d ] && rm -rf $PKG_DEST/etc/pam.d/* + + + install -m644 $PKG_DEST/etc/login.defs $PKG_DEST/etc/login.defs.orig && + echo "USERGROUPS_ENAB yes"> $PKG_DEST/etc/login.defs + + for f in $ADDITIONAL; do + case $f in + *.pamd) + cp $f $PKG_DEST/etc/pam.d/${f%.pamd} + ;; + esac + done + cp $PKG_DEST/etc/pam.d/su $PKG_DEST/etc/pam.d/su-l + + for PROGRAM in chfn chgpasswd chsh groupadd groupdel \ + groupmems groupmod useradd userdel usermod + do + install -m644 chage.pamd $PKG_DEST/etc/pam.d/${PROGRAM} + sed -i "s/chage/$PROGRAM/" $PKG_DEST/etc/pam.d/${PROGRAM} + done + + [ -f $PKG_DEST/etc/login.access ] && mv $PKG_DEST/etc/login.access $PKG_DEST/etc/login.access.NOUSE || true + [ -f $PKG_DEST/etc/limits ] && mv $PKG_DEST/etc/limits $PKG_DEST/etc/limits.NOUSE || true + + rm $PKG_DEST/usr/bin/su +} + +postinstall () { + + [ ! -f /etc/passwd ] && + cat > /etc/passwd << "EOF" +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/usr/bin/false +daemon:x:6:6:Daemon User:/dev/null:/usr/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/run/dbus:/usr/bin/false +uuidd:x:80:80:UUID Generation Daemon User:/dev/null:/usr/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/usr/bin/false +EOF + + [ ! -f /etc/group ] && + cat > /etc/group << "EOF" +root:x:0:root +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +input:x:24: +mail:x:34: +kvm:x:61: +uuidd:x:80: +wheel:x:97: +nogroup:x:99: +users:x:999: +EOF + /usr/sbin/pwconv + /usr/sbin/grpconv + chmod 0640 /etc/shadow + mkdir -p /etc/default + /usr/sbin/useradd -D --gid 999 +} diff --git a/repo/system/shadow/su.pamd b/repo/system/shadow/su.pamd new file mode 100644 index 0000000..ca6ab90 --- /dev/null +++ b/repo/system/shadow/su.pamd @@ -0,0 +1,27 @@ +# Begin /etc/pam.d/su + +# always allow root +auth sufficient pam_rootok.so + +# Allow users in the wheel group to execute su without a password +# disabled by default +#auth sufficient pam_wheel.so trust use_uid + +# include system auth settings +auth include system-auth + +# limit su to users in the wheel group +# disabled by default +#auth required pam_wheel.so use_uid + +# include system account settings +account include system-account + +# Set default environment variables for the service user +session required pam_env.so + +# include system session settings +session include system-session + +# End /etc/pam.d/su + diff --git a/repo/system/shared-mime-info.xibuild b/repo/system/shared-mime-info.xibuild deleted file mode 100644 index cb6b887..0000000 --- a/repo/system/shared-mime-info.xibuild +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -NAME="shared-mime-info" -DESC="Freedesktop.org Shared MIME Info" - -MAKEDEPS="meson ninja itstool libxml2-utils xmlto libxml2 glib" -DEPS="sbase glib libxml2 musl pkg-config " - -PKG_VER=2.2 -SOURCE="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/$PKG_VER/shared-mime-info-$PKG_VER.tar.gz" -ADDITIONAL=" - https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/shared-mime-info/trunk/MR_162.patch -" - -prepare () { - patch -Rp1 -i MR_162.patch -} - -build () { - mkdir build && - cd build && - meson --prefix=/usr \ - -Dupdate-mimedb=false \ - .. && - ninja -} - -package () { - DESTDIR=$PKG_DEST ninja install -} - -postinstall () { - update-mime-database /usr/share/mime -} diff --git a/repo/system/shared-mime-info/shared-mime-info.xibuild b/repo/system/shared-mime-info/shared-mime-info.xibuild new file mode 100644 index 0000000..cb6b887 --- /dev/null +++ b/repo/system/shared-mime-info/shared-mime-info.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +NAME="shared-mime-info" +DESC="Freedesktop.org Shared MIME Info" + +MAKEDEPS="meson ninja itstool libxml2-utils xmlto libxml2 glib" +DEPS="sbase glib libxml2 musl pkg-config " + +PKG_VER=2.2 +SOURCE="https://gitlab.freedesktop.org/xdg/shared-mime-info/-/archive/$PKG_VER/shared-mime-info-$PKG_VER.tar.gz" +ADDITIONAL=" + https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/shared-mime-info/trunk/MR_162.patch +" + +prepare () { + patch -Rp1 -i MR_162.patch +} + +build () { + mkdir build && + cd build && + meson --prefix=/usr \ + -Dupdate-mimedb=false \ + .. && + ninja +} + +package () { + DESTDIR=$PKG_DEST ninja install +} + +postinstall () { + update-mime-database /usr/share/mime +} diff --git a/repo/system/skalibs.xibuild b/repo/system/skalibs.xibuild deleted file mode 100644 index 0833b6c..0000000 --- a/repo/system/skalibs.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="" -DEPS="musl" - -PKG_VER=2.11.1.0 -SOURCE=https://skarnet.org/software/skalibs/skalibs-$PKG_VER.tar.gz - -DESC="General purpose libraries for skarnet.org software" - -build () { - ./configure \ - --enable-shared \ - --enable-static \ - --libdir=/usr/lib - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - diff --git a/repo/system/skalibs/skalibs.xibuild b/repo/system/skalibs/skalibs.xibuild new file mode 100644 index 0000000..0833b6c --- /dev/null +++ b/repo/system/skalibs/skalibs.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="musl" + +PKG_VER=2.11.1.0 +SOURCE=https://skarnet.org/software/skalibs/skalibs-$PKG_VER.tar.gz + +DESC="General purpose libraries for skarnet.org software" + +build () { + ./configure \ + --enable-shared \ + --enable-static \ + --libdir=/usr/lib + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + diff --git a/repo/system/slang.xibuild b/repo/system/slang.xibuild deleted file mode 100644 index b480936..0000000 --- a/repo/system/slang.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="" -DEPS="pcre2" - -PKG_VER=2.3.2 -SOURCE=https://www.jedsoft.org/releases/slang/slang-$PKG_VER.tar.bz2 -DESC="S-Lang is a powerful interpreted language" - -build () { - ./configure --prefix=/usr \ - --sysconfdir=/etc - make -j1 -} - -package () { - make DESTDIR=$PKG_DEST install-all -j1 -} diff --git a/repo/system/slang/slang.xibuild b/repo/system/slang/slang.xibuild new file mode 100644 index 0000000..b480936 --- /dev/null +++ b/repo/system/slang/slang.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="pcre2" + +PKG_VER=2.3.2 +SOURCE=https://www.jedsoft.org/releases/slang/slang-$PKG_VER.tar.bz2 +DESC="S-Lang is a powerful interpreted language" + +build () { + ./configure --prefix=/usr \ + --sysconfdir=/etc + make -j1 +} + +package () { + make DESTDIR=$PKG_DEST install-all -j1 +} diff --git a/repo/system/snappy.xibuild b/repo/system/snappy.xibuild deleted file mode 100644 index e266327..0000000 --- a/repo/system/snappy.xibuild +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/sh - -NAME="snappy" -DESC="Fast compression and decompression library" - -MAKEDEPS="cmake" -DEPS="musl " - -PKG_VER=1.1.9 -SOURCE="https://github.com/google/snappy/archive/$PKG_VER.tar.gz" - -_googletest_commit=18f8200e3079b0e54fa00cb7ac55d4c39dcf6da6 -ADDITIONAL=" -rtti.patch fix-inline.patch -https://github.com/google/googletest/archive/$_googletest_commit.tar.gz" - -prepare () { - apply_patches - rmdir third_party/googletest - tar xvf $_googletest_commit.tar.gz - ln -s ../googletest-$_googletest_commit third_party/googletest -} - -build () { - cmake -B build -G Ninja \ - -DCMAKE_INSTALL_PREFIX=/usr \ - -DCMAKE_INSTALL_LIBDIR=/usr/lib \ - -DBUILD_SHARED_LIBS=ON \ - -DBUILD_STATIC_LIBS=OFF \ - -DSNAPPY_BUILD_BENCHMARKS=OFF - - cmake --build build -} - -package () { - DESTDIR="$PKG_DEST" cmake --install build -} diff --git a/repo/system/snappy/cmakelists.patch b/repo/system/snappy/cmakelists.patch new file mode 100644 index 0000000..d6576a8 --- /dev/null +++ b/repo/system/snappy/cmakelists.patch @@ -0,0 +1,76 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -213,19 +219,28 @@ + "snappy-stubs-public.h.in" + "${PROJECT_BINARY_DIR}/snappy-stubs-public.h") + ++# When BUILD_SHARED_LIBS is: ++# ON it will generate a SHARED library ++# OFF it will generate a STATIC library + add_library(snappy "") +-target_sources(snappy +- PRIVATE ++ ++# Used to generate both lib types ++if (BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS) ++ add_library(snappy_static STATIC "") ++ set_target_properties(snappy_static PROPERTIES OUTPUT_NAME snappy) ++ install(TARGETS snappy_static DESTINATION ${CMAKE_INSTALL_LIBDIR}) ++endif () ++ ++set(SNAPPY_SOURCE_PRIVATE + "snappy-internal.h" + "snappy-stubs-internal.h" + "snappy-c.cc" + "snappy-sinksource.cc" + "snappy-stubs-internal.cc" + "snappy.cc" +- "${PROJECT_BINARY_DIR}/config.h" ++ "${PROJECT_BINARY_DIR}/config.h") + +- # Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". +- $<$:PUBLIC> ++set(SNAPPY_SOURCE_PUBLIC + $ + $ + $ +@@ -233,18 +248,32 @@ + $ + $ + $ +- $ +-) +-target_include_directories(snappy +- PUBLIC ++ $) ++ ++set(SNAPPY_INCLUDE_DIRS + $ + $ +- $ +-) ++ $) ++ ++# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". ++target_sources(snappy PRIVATE ${SNAPPY_SOURCE_PRIVATE} ++ $<$:PUBLIC> ${SNAPPY_SOURCE_PUBLIC}) ++ ++target_include_directories(snappy PUBLIC ${SNAPPY_INCLUDE_DIRS}) ++ ++target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H) ++ ++# Only CMake 3.3+ supports PUBLIC sources in targets exported by "install". ++target_sources(snappy_static PRIVATE ${SNAPPY_SOURCE_PRIVATE} ++ $<$:PUBLIC> ${SNAPPY_SOURCE_PUBLIC}) ++ ++target_include_directories(snappy_static PUBLIC ${SNAPPY_INCLUDE_DIRS}) ++ ++target_compile_definitions(snappy_static PRIVATE -DHAVE_CONFIG_H) ++ + set_target_properties(snappy + PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}) + +-target_compile_definitions(snappy PRIVATE -DHAVE_CONFIG_H) + if(BUILD_SHARED_LIBS) + set_target_properties(snappy PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON) + endif(BUILD_SHARED_LIBS) diff --git a/repo/system/snappy/fix-inline.patch b/repo/system/snappy/fix-inline.patch new file mode 100644 index 0000000..96484e0 --- /dev/null +++ b/repo/system/snappy/fix-inline.patch @@ -0,0 +1,13 @@ +Patch-Source: https://github.com/google/snappy/pull/128 + +--- a/snappy.cc ++++ b/snappy.cc +@@ -1014,7 +1014,7 @@ + } + + SNAPPY_ATTRIBUTE_ALWAYS_INLINE +-size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { ++inline size_t AdvanceToNextTag(const uint8_t** ip_p, size_t* tag) { + const uint8_t*& ip = *ip_p; + // This section is crucial for the throughput of the decompression loop. + // The latency of an iteration is fundamentally constrained by the diff --git a/repo/system/snappy/rtti.patch b/repo/system/snappy/rtti.patch new file mode 100644 index 0000000..80f89ff --- /dev/null +++ b/repo/system/snappy/rtti.patch @@ -0,0 +1,56 @@ +From f73b11e87dfbe1cb4862b8ee489679d99534f40b Mon Sep 17 00:00:00 2001 +From: Tim Serong +Date: Wed, 27 Oct 2021 18:49:04 +1100 +Subject: [PATCH] Re-enable RTTI (needed in order to subclass Source, etc.) + +Commit c98344f in snappy 1.1.9 disabled RTTI, which means the +snappy library no longer exports typeinfo for snappy::Source, +snappy::Sink, ..., so users of the library can't subclass these +classes anymore. + +Here's a trivial reproducer: + + #include + class MySource : snappy::Source { + public: + size_t Available() const override { return 0; } + const char *Peek(size_t *len) override { return NULL; } + void Skip(size_t n) override {} + }; + int main(int argc, char **argv) { + MySource m; + return 0; + } + +Try `g++ -o snappy-test ./snappy-test.cc -lsnappy` with the above +and the linker will fail with "undefined reference to `typeinfo +for snappy::Source'" if RTTI was disabled in the snappy build. +--- + CMakeLists.txt | 7 ------- + 1 file changed, 7 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6eef485..755605d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -51,10 +51,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REGEX REPLACE "/EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHs-c-") + add_definitions(-D_HAS_EXCEPTIONS=0) +- +- # Disable RTTI. +- string(REGEX REPLACE "/GR" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /GR-") + else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + # Use -Wall for clang and gcc. + if(NOT CMAKE_CXX_FLAGS MATCHES "-Wall") +@@ -77,9 +73,6 @@ else(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + string(REGEX REPLACE "-fexceptions" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions") + +- # Disable RTTI. +- string(REGEX REPLACE "-frtti" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") + endif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + + # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to make diff --git a/repo/system/snappy/snappy.xibuild b/repo/system/snappy/snappy.xibuild new file mode 100644 index 0000000..e266327 --- /dev/null +++ b/repo/system/snappy/snappy.xibuild @@ -0,0 +1,37 @@ +#!/bin/sh + +NAME="snappy" +DESC="Fast compression and decompression library" + +MAKEDEPS="cmake" +DEPS="musl " + +PKG_VER=1.1.9 +SOURCE="https://github.com/google/snappy/archive/$PKG_VER.tar.gz" + +_googletest_commit=18f8200e3079b0e54fa00cb7ac55d4c39dcf6da6 +ADDITIONAL=" +rtti.patch fix-inline.patch +https://github.com/google/googletest/archive/$_googletest_commit.tar.gz" + +prepare () { + apply_patches + rmdir third_party/googletest + tar xvf $_googletest_commit.tar.gz + ln -s ../googletest-$_googletest_commit third_party/googletest +} + +build () { + cmake -B build -G Ninja \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + -DBUILD_SHARED_LIBS=ON \ + -DBUILD_STATIC_LIBS=OFF \ + -DSNAPPY_BUILD_BENCHMARKS=OFF + + cmake --build build +} + +package () { + DESTDIR="$PKG_DEST" cmake --install build +} diff --git a/repo/system/sqlite3.xibuild b/repo/system/sqlite3.xibuild deleted file mode 100644 index 12f7210..0000000 --- a/repo/system/sqlite3.xibuild +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="libedit" - -PKG_VER=3370200 -SOURCE=https://sqlite.org/2022/sqlite-autoconf-$PKG_VER.tar.gz -DESC="Small suite of programs for UNIX, designed to allow process supervision" - -build () { - ./configure --prefix=/usr \ - --disable-static \ - --enable-fts5 \ - CPPFLAGS="-DSQLITE_ENABLE_FTS3=1 \ - -DSQLITE_ENABLE_FTS4=1 \ - -DSQLITE_ENABLE_COLUMN_METADATA=1 \ - -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \ - -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ - -DSQLITE_SECURE_DELETE=1 \ - -DSQLITE_ENABLE_FTS3_TOKENIZER=1" && - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/sqlite3/sqlite3.xibuild b/repo/system/sqlite3/sqlite3.xibuild new file mode 100644 index 0000000..12f7210 --- /dev/null +++ b/repo/system/sqlite3/sqlite3.xibuild @@ -0,0 +1,26 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="libedit" + +PKG_VER=3370200 +SOURCE=https://sqlite.org/2022/sqlite-autoconf-$PKG_VER.tar.gz +DESC="Small suite of programs for UNIX, designed to allow process supervision" + +build () { + ./configure --prefix=/usr \ + --disable-static \ + --enable-fts5 \ + CPPFLAGS="-DSQLITE_ENABLE_FTS3=1 \ + -DSQLITE_ENABLE_FTS4=1 \ + -DSQLITE_ENABLE_COLUMN_METADATA=1 \ + -DSQLITE_ENABLE_UNLOCK_NOTIFY=1 \ + -DSQLITE_ENABLE_DBSTAT_VTAB=1 \ + -DSQLITE_SECURE_DELETE=1 \ + -DSQLITE_ENABLE_FTS3_TOKENIZER=1" && + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/startup-notification.xibuild b/repo/system/startup-notification.xibuild deleted file mode 100644 index 08d7a85..0000000 --- a/repo/system/startup-notification.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -NAME="startup-notification" -DESC="Monitor and display application startup" - -MAKEDEPS="make " -DEPS="libx11 libxcb musl xcb-util " - -PKG_VER=0.12 -SOURCE="https://www.freedesktop.org/software/startup-notification/releases/startup-notification-$PKG_VER.tar.gz" - -build () { - ./configure \ - --prefix=/usr - --bindir=/usr/bin \ - --sysconfdir=/etc \ - --disable-static - make -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/startup-notification/startup-notification.xibuild b/repo/system/startup-notification/startup-notification.xibuild new file mode 100644 index 0000000..08d7a85 --- /dev/null +++ b/repo/system/startup-notification/startup-notification.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +NAME="startup-notification" +DESC="Monitor and display application startup" + +MAKEDEPS="make " +DEPS="libx11 libxcb musl xcb-util " + +PKG_VER=0.12 +SOURCE="https://www.freedesktop.org/software/startup-notification/releases/startup-notification-$PKG_VER.tar.gz" + +build () { + ./configure \ + --prefix=/usr + --bindir=/usr/bin \ + --sysconfdir=/etc \ + --disable-static + make +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/sysklogd.xibuild b/repo/system/sysklogd.xibuild deleted file mode 100644 index 87370e4..0000000 --- a/repo/system/sysklogd.xibuild +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.3.0 -SOURCE=https://github.com/troglobit/sysklogd/releases/download/v$PKG_VER/sysklogd-$PKG_VER.tar.gz -ADDITIONAL=" -sysklogd.initd -" -DESC="Programs for logging system messages" - -build () { - ./configure --prefix=/usr --sysconfdir=/etc && - make -} - -package () { - make DESTDIR=$PKG_DEST install - mkdir -p $PKG_DEST/etc - - cat > $PKG_DEST/etc/syslog.conf << "EOF" -# Begin /etc/syslog.conf - -auth,authpriv.* -/var/log/auth.log -*.*;auth,authpriv.none -/var/log/sys.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log -*.emerg * - -# End /etc/syslog.conf -EOF - install -Dm 754 sysklogd.initd $PKG_DEST/etc/init.d/sysklogd - mkdir -p $PKG_DEST/etc/runlevels/default/ - ln -s /etc/init.d/sysklogd $PKG_DEST/etc/runlevels/default/sysklogd -} diff --git a/repo/system/sysklogd/sysklogd.initd b/repo/system/sysklogd/sysklogd.initd new file mode 100644 index 0000000..74b13bd --- /dev/null +++ b/repo/system/sysklogd/sysklogd.initd @@ -0,0 +1,3 @@ +#!/sbin/openrc-run + +command=/bin/syslogd diff --git a/repo/system/sysklogd/sysklogd.xibuild b/repo/system/sysklogd/sysklogd.xibuild new file mode 100644 index 0000000..87370e4 --- /dev/null +++ b/repo/system/sysklogd/sysklogd.xibuild @@ -0,0 +1,38 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.3.0 +SOURCE=https://github.com/troglobit/sysklogd/releases/download/v$PKG_VER/sysklogd-$PKG_VER.tar.gz +ADDITIONAL=" +sysklogd.initd +" +DESC="Programs for logging system messages" + +build () { + ./configure --prefix=/usr --sysconfdir=/etc && + make +} + +package () { + make DESTDIR=$PKG_DEST install + mkdir -p $PKG_DEST/etc + + cat > $PKG_DEST/etc/syslog.conf << "EOF" +# Begin /etc/syslog.conf + +auth,authpriv.* -/var/log/auth.log +*.*;auth,authpriv.none -/var/log/sys.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log +*.emerg * + +# End /etc/syslog.conf +EOF + install -Dm 754 sysklogd.initd $PKG_DEST/etc/init.d/sysklogd + mkdir -p $PKG_DEST/etc/runlevels/default/ + ln -s /etc/init.d/sysklogd $PKG_DEST/etc/runlevels/default/sysklogd +} diff --git a/repo/system/syslinux.xibuild b/repo/system/syslinux.xibuild deleted file mode 100644 index 19edc66..0000000 --- a/repo/system/syslinux.xibuild +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="util-linux sbase musl" - -PKG_VER=6.03 -SOURCE=https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/${PKG_VER%.*}.xx/syslinux-$PKG_VER.tar.xz -ADDITIONAL=" - update-extlinux.conf - update-extlinux - 0018-prevent-pow-optimization.patch - fix-sysmacros.patch - " -DESC="Boot loader for the Linux operating system" - -prepare () { - apply_patches -} - -build () { - make efi64 installer -} - -package () { - make -j1 INSTALLROOT="$PKG_DEST" MANDIR=/usr/share/man \ - bios efi64 install - - mkdir -p "$PKG_DEST"/etc/update-extlinux.d - cp update-extlinux.conf "$PKG_DEST"/etc/ - sed "/^version=/s/=.*/=$PKG_VER/" update-extlinux \ - > "$PKG_DEST"/sbin/update-extlinux - chmod 755 "$PKG_DEST"/sbin/update-extlinux -} - diff --git a/repo/system/syslinux/0018-prevent-pow-optimization.patch b/repo/system/syslinux/0018-prevent-pow-optimization.patch new file mode 100644 index 0000000..0c42c7b --- /dev/null +++ b/repo/system/syslinux/0018-prevent-pow-optimization.patch @@ -0,0 +1,36 @@ +From: Lukas Schwaighofer +Date: Tue, 26 Feb 2019 23:13:58 +0100 +Subject: Prevent optimizing the pow() function + +With the current GCC 8.2.0 from Debian, a section of code calling pow() in +zzjson_parse.c is turned into a sequence calling exp(). Since no exp() +implementation is available in syslinux those optimizations need to be +disabled. +--- + com32/gpllib/zzjson/zzjson_parse.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/com32/gpllib/zzjson/zzjson_parse.c b/com32/gpllib/zzjson/zzjson_parse.c +index ecb6f61..e66a9d8 100644 +--- a/com32/gpllib/zzjson/zzjson_parse.c ++++ b/com32/gpllib/zzjson/zzjson_parse.c +@@ -138,6 +138,10 @@ static ZZJSON *parse_string2(ZZJSON_CONFIG *config) { + return zzjson; + } + ++static double __attribute__((optimize("O0"))) pow_noopt(double x, double y) { ++ return pow(x, y); ++} ++ + static ZZJSON *parse_number(ZZJSON_CONFIG *config) { + ZZJSON *zzjson; + unsigned long long ival = 0, expo = 0; +@@ -213,7 +217,7 @@ skipexpo: + if (dbl) { + dval = sign * (long long) ival; + dval += sign * frac; +- dval *= pow(10.0, (double) signexpo * expo); ++ dval *= pow_noopt(10.0, (double) signexpo * expo); + } + + zzjson = config->calloc(1, sizeof(ZZJSON)); diff --git a/repo/system/syslinux/fix-sysmacros.patch b/repo/system/syslinux/fix-sysmacros.patch new file mode 100644 index 0000000..dd622e8 --- /dev/null +++ b/repo/system/syslinux/fix-sysmacros.patch @@ -0,0 +1,12 @@ +diff --git a/extlinux/main.c b/extlinux/main.c +index a7ebd49..69bb164 100644 +--- a/extlinux/main.c ++++ b/extlinux/main.c +@@ -41,6 +41,7 @@ + #include + #include + #include ++#include + + #include "linuxioctl.h" + diff --git a/repo/system/syslinux/gcc-10.patch b/repo/system/syslinux/gcc-10.patch new file mode 100644 index 0000000..b5bbad0 --- /dev/null +++ b/repo/system/syslinux/gcc-10.patch @@ -0,0 +1,109 @@ +From 951928f2cad5682c2844e6bd0f7201236c5d9b66 Mon Sep 17 00:00:00 2001 +From: Merlin Mathesius +Date: Wed, 13 May 2020 08:02:27 -0500 +Subject: [PATCH] Workaround multiple definition of symbol errors + +--- + com32/cmenu/Makefile | 2 +- + com32/elflink/ldlinux/Makefile | 2 +- + com32/gpllib/Makefile | 2 +- + com32/hdt/Makefile | 2 +- + core/Makefile | 2 +- + dos/Makefile | 2 +- + efi/Makefile | 2 +- + 7 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile +index b81b68ed..2ae989c4 100644 +--- a/com32/cmenu/Makefile ++++ b/com32/cmenu/Makefile +@@ -49,7 +49,7 @@ makeoutputdirs: + @mkdir -p $(OBJ)/libmenu + + libmenu/libmenu.elf: $(LIBMENU) +- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) \ ++ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) \ + -o $@ $^ + + tidy dist: +diff --git a/com32/elflink/ldlinux/Makefile b/com32/elflink/ldlinux/Makefile +index 87c0d362..2be2a01a 100644 +--- a/com32/elflink/ldlinux/Makefile ++++ b/com32/elflink/ldlinux/Makefile +@@ -33,7 +33,7 @@ endif + all: $(BTARGET) ldlinux_lnx.a + + ldlinux.elf : $(OBJS) +- $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS) ++ $(LD) $(LDFLAGS) -z muldefs -soname $(SONAME) -o $@ $^ $(LIBS) + + LNXCFLAGS += -D__export='__attribute__((visibility("default")))' + LNXLIBOBJS = get_key.lo +diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile +index 1fec9145..2d764d0b 100644 +--- a/com32/gpllib/Makefile ++++ b/com32/gpllib/Makefile +@@ -24,7 +24,7 @@ makeoutputdirs: + $(addprefix $(OBJ),$(sort $(dir $(LIBOBJS)))),$(b)) + + libgpl.elf : $(LIBOBJS) +- $(LD) -shared $(LDFLAGS) -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ ++ $(LD) -shared $(LDFLAGS) -z muldefs -soname $(patsubst %.elf,%.c32,$(@F)) -o $@ $^ + + tidy dist clean: + find . \( -name \*.o -o -name .\*.d -o -name \*.tmp \) -print0 | \ +diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile +index 61736d05..1d947857 100644 +--- a/com32/hdt/Makefile ++++ b/com32/hdt/Makefile +@@ -52,7 +52,7 @@ QEMU ?= qemu-kvm + all: $(MODULES) $(TESTFILES) + + hdt.elf : $(OBJS) $(LIBS) $(C_LIBS) +- $(LD) $(LDFLAGS) -o $@ $^ ++ $(LD) $(LDFLAGS) -z muldefs -o $@ $^ + + memtest: + -[ ! -f $(FLOPPY_DIR)/$(MEMTEST) ] && $(WGET) $(MEMTEST_URL) -O $(FLOPPY_DIR)/$(MEMTEST) +diff --git a/core/Makefile b/core/Makefile +index 46cb037c..f0cfcbe9 100644 +--- a/core/Makefile ++++ b/core/Makefile +@@ -156,7 +156,7 @@ LDSCRIPT = $(SRC)/$(ARCH)/syslinux.ld + NASM_ELF = elf + + %.elf: %.o $(LIBDEP) $(LDSCRIPT) $(AUXLIBS) +- $(LD) $(LDFLAGS) -pie -Bsymbolic \ ++ $(LD) $(LDFLAGS) -z muldefs -pie -Bsymbolic \ + -T $(LDSCRIPT) \ + --unresolved-symbols=report-all \ + -E --hash-style=gnu -M -o $@ $< \ +diff --git a/dos/Makefile b/dos/Makefile +index 4c930d19..5d1c72ca 100644 +--- a/dos/Makefile ++++ b/dos/Makefile +@@ -19,7 +19,7 @@ include $(MAKEDIR)/embedded.mk + CFLAGS += -D__MSDOS__ -mregparm=3 -DREGPARM=3 + # CFLAGS += -DDEBUG + +-LDFLAGS = -T $(SRC)/dosexe.ld ++LDFLAGS = -T $(SRC)/dosexe.ld -z muldefs + OPTFLAGS = -g + INCLUDES = -include code16.h -nostdinc -iwithprefix include \ + -I$(SRC) -I$(SRC)/.. -I$(SRC)/../libfat \ +diff --git a/efi/Makefile b/efi/Makefile +index bbf23f24..3dd922d5 100644 +--- a/efi/Makefile ++++ b/efi/Makefile +@@ -69,7 +69,7 @@ $(OBJS): | $(OBJ)/$(ARCH) + BTARGET = syslinux.efi + + syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS) +- $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi ++ $(LD) $(LDFLAGS) -z muldefs --strip-debug -o $@ $^ -lgnuefi -lefi + + # We need to rename the .hash section because the EFI firmware + # linker really doesn't like it. +-- +2.25.1 + diff --git a/repo/system/syslinux/syslinux.post-upgrade b/repo/system/syslinux/syslinux.post-upgrade new file mode 100644 index 0000000..9038866 --- /dev/null +++ b/repo/system/syslinux/syslinux.post-upgrade @@ -0,0 +1,61 @@ +#!/bin/sh + +# find given append opt +get_append_opt() { + awk -v search="$1" ' + $1 == "append" || $1 == "APPEND" { + split($0, a); + for (i in a) { + if (index(a[i], search) == 1) { + print a[i]; + } + } + }' /boot/extlinux.conf | sort | uniq +} + +# print default kernel options +get_default_opts() { + awk ' + $1 == "append" || $1 == "APPEND" { + opts=""; + space=""; + split($0, a); + for (i in a) { + if (i != 1 \ + && (index(a[i], "root=") != 1) \ + && (index(a[i], "initrd=") != 1) \ + && (index(a[i], "modules=") != 1)) { + opts = opts space a[i]; + space = " "; + } + } + print opts; + } + ' /boot/extlinux.conf | sort | uniq +} + +if ! [ -f /boot/extlinux.conf ]; then + exit 0 +fi + +# check if we already have a generated extlinux.conf +if grep -q '^# Generated by update-extlinux' /boot/extlinux.conf; then + exit 0 +fi + +# try fish out the kernel opts from extlinuix.conf's append line +root=$(get_append_opt 'root=' | head -n 1) +modules=$(get_append_opt 'modules=' | head -n 1) +opts=$(get_default_opts | head -n 1) + +# populate update-extlinux.conf with the info we know +if [ -n "$root" ]; then + sed -i -e "/^root=/s|.*|$root|g" /etc/update-extlinux.conf +fi +if [ -n "$modules" ]; then + sed -i -e "/^modules=/s|.*|$modules|g" /etc/update-extlinux.conf +fi +if [ -n "$opts" ]; then + sed -i -e "/^default_kernel_opts=/s|.*|default_kernel_opts=\"$opts\"|g" /etc/update-extlinux.conf +fi + diff --git a/repo/system/syslinux/syslinux.trigger b/repo/system/syslinux/syslinux.trigger new file mode 100644 index 0000000..fe91f43 --- /dev/null +++ b/repo/system/syslinux/syslinux.trigger @@ -0,0 +1,3 @@ +#!/bin/sh + +update-extlinux --warn-only diff --git a/repo/system/syslinux/syslinux.xibuild b/repo/system/syslinux/syslinux.xibuild new file mode 100644 index 0000000..19edc66 --- /dev/null +++ b/repo/system/syslinux/syslinux.xibuild @@ -0,0 +1,34 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="util-linux sbase musl" + +PKG_VER=6.03 +SOURCE=https://mirrors.edge.kernel.org/pub/linux/utils/boot/syslinux/${PKG_VER%.*}.xx/syslinux-$PKG_VER.tar.xz +ADDITIONAL=" + update-extlinux.conf + update-extlinux + 0018-prevent-pow-optimization.patch + fix-sysmacros.patch + " +DESC="Boot loader for the Linux operating system" + +prepare () { + apply_patches +} + +build () { + make efi64 installer +} + +package () { + make -j1 INSTALLROOT="$PKG_DEST" MANDIR=/usr/share/man \ + bios efi64 install + + mkdir -p "$PKG_DEST"/etc/update-extlinux.d + cp update-extlinux.conf "$PKG_DEST"/etc/ + sed "/^version=/s/=.*/=$PKG_VER/" update-extlinux \ + > "$PKG_DEST"/sbin/update-extlinux + chmod 755 "$PKG_DEST"/sbin/update-extlinux +} + diff --git a/repo/system/syslinux/update-extlinux b/repo/system/syslinux/update-extlinux new file mode 100644 index 0000000..4799cd3 --- /dev/null +++ b/repo/system/syslinux/update-extlinux @@ -0,0 +1,284 @@ +#!/bin/sh + +version= +default=0 +timeout=5 +verbose=0 + +conf=/boot/extlinux.conf +myconf=/etc/update-extlinux.conf + +# read in extlinux settings +if [ -f "$myconf" ]; then + . $myconf +fi + +everbose() { + if [ "$verbose" = "0" ]; then + return + fi + + echo $* +} + +ewarn() { + echo "WARNING:" $@ >&2 +} + +eerror() { + echo "ERROR:" $@ >&2 + return 1 +} + +usage() { + echo "usage: $0 [-v|--verbose] [--warn-only]" +} + +while [ $# -gt 0 ]; do + opt="$1" + shift + case "$opt" in + -v|--verbose) + verbose=1 + ;; + --warn-only) + warn_only=1 + ;; + --) + break + ;; + -*) + usage + exit 1 + ;; + esac +done + +everbose "Updating extlinux configuration." + +if [ "x$root" = "x" ]; then + ewarn "Root device is not specified in $myconf." + blkid_export=$(blkid -o export /dev/root) + if [ -n "$blkid_export" ]; then + export $blkid_export + fi + if [ -z "$UUID" ]; then + # try parse /proc/mount for mounted / + dev=$(awk '$2 == "/" {dev=$1} END {print dev}' /proc/mounts) + if [ -n "$dev" ]; then + blkid_export=$(blkid -o export $dev) + if [ -n "$blkid_export" ]; then + export "$blkid_export" + fi + fi + fi + if [ -z "$UUID" ]; then + if [ -z "$dev" ]; then + if [ -n "$warn_only" ]; then + ewarn "Failed to detect root device. extlinux.conf is not updated" + exit 0 + else + eerror "Failed to detect root device" + exit 1 + fi + else + root=$dev + fi + else + root=UUID=$UUID + fi + everbose "Root device is: $root" +fi + +rtimeout=$(( ${timeout} * 10 )) +syslinux_menu=menu.c32 +menu_hidden= + +# vesa menu has been requested? +if [ "$vesa_menu" = "1" ]; then + syslinux_menu=vesamenu.c32 +fi + +umask 0022 +rm -f $conf.new +echo "# Generated by update-extlinux $version" > $conf.new +if [ -n "$serial_port" ]; then + echo "SERIAL $serial_port ${serial_baud:-115200}" >> $conf.new +fi +echo "DEFAULT $syslinux_menu" >> $conf.new +echo "PROMPT 0" >> $conf.new +echo "MENU TITLE XiLinux/$(uname -s) Boot Menu" >> $conf.new +if [ "$hidden" = "1" ]; then + echo "MENU HIDDEN" >> $conf.new +fi +echo "MENU AUTOBOOT XiLinux will be booted automatically in # seconds." >> $conf.new +echo "TIMEOUT $rtimeout" >> $conf.new + +lst=0 +if [ -f "/boot/xen.gz" ]; then + for kernel in $(find /boot -name "vmlinuz-*" -type f); do + tag=$(basename $kernel | cut -b9-) + everbose "Found Xen hypervisor: /boot/xen.gz, kernel: $kernel" + + if [ -f "/boot/initramfs-$tag" ]; then + everbose "Found initramfs: /boot/initramfs-$tag" + initramfs="initramfs-$tag" + else + initramfs= + fi + initramfs_stage="${initramfs:+---} $initramfs" + + if [ -f "/boot/amd-ucode.img" ]; then + everbose "Found microcode for AMD CPUs: /boot/amd-ucode.img" + ucode_image_amd="amd-ucode.img" + case "$xen_opts" in + *ucode=scan* ) ;; + * ) xen_opts="$xen_opts ucode=scan" ;; + esac + fi + if [ -f "/boot/intel-ucode.img" ]; then + everbose "Found microcode for Intel CPUs: /boot/intel-ucode.img" + ucode_image_intel="intel-ucode.img" + case "$xen_opts" in + *ucode=scan* ) ;; + * ) xen_opts="$xen_opts ucode=scan" ;; + esac + fi + ucode_image_stage="${ucode_image_amd:+---} $ucode_image_amd ${ucode_image_intel:+---} $ucode_image_intel" + + label=xen-$(grep -w -l $tag /usr/share/kernel/*/kernel.release \ + | cut -d/ -f5) + if [ "$label" = "xen-" ]; then + label=xen-$lst + fi + + dom0_kernel_stage="--- $(basename $kernel) root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts" + + echo "LABEL $label" >> $conf.new + if [ "$label" = "$default" ]; then + echo " MENU DEFAULT" >> $conf.new + fi + echo " MENU LABEL Xen + Linux $tag" >> $conf.new + echo " COM32 mboot.c32" >> $conf.new + echo " APPEND xen.gz $xen_opts $dom0_kernel_stage $initramfs_stage $ucode_image_stage" >> $conf.new + echo "" >> $conf.new + lst=$(($lst + 1)) + done +fi + +for kernel in $(find /boot -name "vmlinuz*" -type f); do + case $kernel in + *vmlinuz) tag=vanilla;; + *vmlinuz-*) tag=$(basename $kernel | cut -b9-);; + *) continue;; + esac + everbose "Found kernel: $kernel" + label=$(grep -w -l $tag /usr/share/kernel/*/kernel.release | cut -d/ -f5) + if [ -z "$label" ]; then + if [ "$tag" = vanilla ]; then + label="vanilla" + else + label=$lst + fi + fi + echo "LABEL $label" >> $conf.new + if [ "$label" = "$default" ]; then + echo " MENU DEFAULT" >> $conf.new + fi + echo " MENU LABEL Linux $tag" >> $conf.new + echo " LINUX $(basename $kernel)" >> $conf.new + initrd= + if [ -f "/boot/initramfs-$tag" ]; then + everbose "Found initramfs: /boot/initramfs-$tag" + initrd="initramfs-$tag" + fi + if [ -f "/boot/amd-ucode.img" ]; then + everbose "Found microcode for AMD CPUs: /boot/amd-ucode.img" + initrd="amd-ucode.img${initrd:+,}${initrd}" + fi + if [ -f "/boot/intel-ucode.img" ]; then + everbose "Found microcode for Intel CPUs: /boot/intel-ucode.img" + initrd="intel-ucode.img${initrd:+,}${initrd}" + fi + echo " INITRD ${initrd}" >> $conf.new + echo " APPEND root=$root modules=${modules}${TYPE:+,$TYPE} $default_kernel_opts" >> $conf.new + echo "" >> $conf.new + lst=$(($lst + 1)) +done + +if [ -n "$password" ]; then + echo "NOESCAPE 1" >> $conf.new + echo "MENU MASTER PASSWD $password" >> $conf.new + echo "" >> $conf.new + chmod o-r $conf.new +fi + +everbose "$lst entries found." + +for entry in /etc/update-extlinux.d/*; do + [ -f "$entry" ] && { cat $entry; echo ""; } >> $conf.new +done + +echo "MENU SEPARATOR" >> $conf.new +echo "" >> $conf.new + +if [ -f "/boot/hdt.c32" ]; then + everbose "Found Hardware Detection Tool: /boot/hdt.c32" + echo "LABEL hdt" >> $conf.new + echo " MENU LABEL Hardware info" >> $conf.new + if [ -n "$password" ]; then + echo " MENU PASSWD" >> $conf.new + fi + echo " COM32 hdt.c32" >> $conf.new + if [ -f "/boot/memtest" ]; then + everbose "Found memtest86+: /boot/memtest" + echo " APPEND memtest=memtest" >> $conf.new + fi + echo "" >> $conf.new +elif [ -f "/boot/memtest" ]; then + everbose "Found memtest86+: /boot/memtest" + echo "LABEL memtest" >> $conf.new + echo " MENU LABEL Memtest86+" >> $conf.new + echo " KERNEL memtest" >> $conf.new + echo "" >> $conf.new +fi + +for i in reboot poweroff; do + [ -f "/boot/$i.c32" ] || continue + everbose "Found $i" + # make first char capital + cap=$( echo $i | awk '{sub(".", substr(toupper($0),1,1), $0); print}' ) + echo "LABEL $i" >> $conf.new + echo " MENU LABEL $cap" >> $conf.new + echo " COM32 $i.c32" >> $conf.new + echo "" >> $conf.new +done + +if cmp -s $conf.new $conf; then + everbose "Configuration unchanged." + rm $conf.new +fi + +if [ "$overwrite" != "1" ]; then + exit 0 +elif [ -f "$conf.new" ]; then + # keep a backup just in case + if [ -f "$conf" ]; then + mv $conf $conf.old + fi + + mv $conf.new $conf +fi + +everbose "Installing libutil.c32 libcom32.c32 mboot.c32 menu.c32 vesamenu.c32 to /boot." +cp /usr/share/syslinux/libutil.c32 \ + /usr/share/syslinux/libcom32.c32 \ + /usr/share/syslinux/mboot.c32 \ + /usr/share/syslinux/menu.c32 \ + /usr/share/syslinux/vesamenu.c32 \ + /boot + +case "$(findmnt -n -o FSTYPE -T /boot)" in +ext*) extlinux --update /boot || [ -n "$warn_only" ];; +esac + diff --git a/repo/system/syslinux/update-extlinux.conf b/repo/system/syslinux/update-extlinux.conf new file mode 100644 index 0000000..1dddff2 --- /dev/null +++ b/repo/system/syslinux/update-extlinux.conf @@ -0,0 +1,74 @@ +# configuration for extlinux config builder + +# overwrite +# Overwrite current /boot/extlinux.conf. If this is not '1' we will only +# write to /boot/extlinux.conf.new +overwrite=1 + +# vesa_menu +# use fancy vesa menu (vesamenu.c32) menus, won't work with serial +vesa_menu=0 + +# default_kernel_opts +# default kernel options +default_kernel_opts=quiet + +# modules +# modules which should be loaded before pivot_root +modules=sd-mod,usb-storage,ext4 + +# root +# root device - if not specified, will be guessed using +# blkid -o export /dev/root +root= + +# verbose +# if set to non-zero, update-extlinux will be a lot more verbose. +verbose=0 + +# hidden +# if set to non-zero, the boot menu will be hidden by default. +hidden=1 + +# timeout +# number of seconds to wait before booting default +timeout=3 + +# default +# default kernel to boot +default=lts + +# serial_port +# serial port number - if not specified, serial console will be disabled +serial_port= + +# serial_baud +# the baudrate for the serial port. Will use 115200 if unset +serial_baud=115200 + +# xen_opts +# options to hand to xen hypervisor, useful ones are: +# dom0_mem=384M (give domain-0 environment 384M ram) +xen_opts=dom0_mem=384M + +# if you copy /usr/share/syslinux/reboot.c32 to /boot/, a menu entry +# will be auto-generated for it + +# if you copy hdt.c32, libgpl.c32, and libmenu.c32 from /usr/share/syslinux/ +# to /boot/, a menu entry will be auto-generated for HDT + +# if you download and install /boot/memtest, then if HDT is present it +# will use it, else a separate menu entry will be auto-generated for +# memtest + +# optional password +# you can generate a SHA512 password using: mkpasswd +# +# if you assign a password, you should make this file world-unreadable +# +# if a password is assigned, the menu entries can't be edited at boot +# time, and HDT if present is password-protected +# +# you can also include "MENU PASSWD" in any custom entries you have in +# /etc/update-extlinux.d/ +password='' diff --git a/repo/system/tar.xibuild b/repo/system/tar.xibuild deleted file mode 100644 index 28c2da3..0000000 --- a/repo/system/tar.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.34 -SOURCE=https://ftp.gnu.org/gnu/tar/tar-$PKG_VER.tar.xz -DESC="Utility used to store, backup and transport files" - -build () { - FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr - make -} - -package () { - make DESTDIR=$PKG_DEST install -} - diff --git a/repo/system/tar/tar.xibuild b/repo/system/tar/tar.xibuild new file mode 100644 index 0000000..28c2da3 --- /dev/null +++ b/repo/system/tar/tar.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.34 +SOURCE=https://ftp.gnu.org/gnu/tar/tar-$PKG_VER.tar.xz +DESC="Utility used to store, backup and transport files" + +build () { + FORCE_UNSAFE_CONFIGURE=1 ./configure --prefix=/usr + make +} + +package () { + make DESTDIR=$PKG_DEST install +} + diff --git a/repo/system/tcl.xibuild b/repo/system/tcl.xibuild deleted file mode 100644 index 6495948..0000000 --- a/repo/system/tcl.xibuild +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="zlib" - -PKG_VER=8.6.11 -SOURCE=https://github.com/tcltk/tcl/archive/refs/tags/core-$( echo $PKG_VER | sed "s|\.|-|g").tar.gz -DESC="the Tool Command language, a robust general purpose scripting language" - - -build () { - SRCDIR=$(pwd) - cd unix - ./configure --prefix=/usr --mandir=/usr/share/man $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) - - make - - sed -e "s|$SRCDIR/unix|/usr/lib|" \ - -e "s|$SRCDIR|/usr/include|" \ - -i tclConfig.sh - - sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \ - -e "s|$SRCDIR/pkgs/tdbc1.1.2/generic|/usr/include|" \ - -e "s|$SRCDIR/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \ - -e "s|$SRCDIR/pkgs/tdbc1.1.2|/usr/include|" \ - -i pkgs/tdbc1.1.2/tdbcConfig.sh - - sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \ - -e "s|$SRCDIR/pkgs/itcl4.2.1/generic|/usr/include|" \ - -e "s|$SRCDIR/pkgs/itcl4.2.1|/usr/include|" \ - -i pkgs/itcl4.2.1/itclConfig.sh - - unset SRCDIR -} - -check () { - make test -} - -package () { - make DESTDIR=$PKG_DEST install - - chmod u+w $PKG_DEST/usr/lib/libtcl$(echo $PKG_DEST | cut -d. -f-2).so - - make DESTDIR=$PKG_DEST install-private-headers - - ln $PKG_DEST/usr/bin/tclsh* $PKG_DEST/usr/bin/tclsh - cp -f tclsh9 $PKG_DEST/usr/bin/tclsh - mv $PKG_DEST/usr/share/man/man3/Thread.3 \ - $PKG_DEST/usr/share/man/man3/Tcl_Thread.3 - -} - - diff --git a/repo/system/tcl/tcl.xibuild b/repo/system/tcl/tcl.xibuild new file mode 100644 index 0000000..6495948 --- /dev/null +++ b/repo/system/tcl/tcl.xibuild @@ -0,0 +1,54 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="zlib" + +PKG_VER=8.6.11 +SOURCE=https://github.com/tcltk/tcl/archive/refs/tags/core-$( echo $PKG_VER | sed "s|\.|-|g").tar.gz +DESC="the Tool Command language, a robust general purpose scripting language" + + +build () { + SRCDIR=$(pwd) + cd unix + ./configure --prefix=/usr --mandir=/usr/share/man $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) + + make + + sed -e "s|$SRCDIR/unix|/usr/lib|" \ + -e "s|$SRCDIR|/usr/include|" \ + -i tclConfig.sh + + sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.2/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \ + -e "s|$SRCDIR/pkgs/tdbc1.1.2|/usr/include|" \ + -i pkgs/tdbc1.1.2/tdbcConfig.sh + + sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \ + -e "s|$SRCDIR/pkgs/itcl4.2.1/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/itcl4.2.1|/usr/include|" \ + -i pkgs/itcl4.2.1/itclConfig.sh + + unset SRCDIR +} + +check () { + make test +} + +package () { + make DESTDIR=$PKG_DEST install + + chmod u+w $PKG_DEST/usr/lib/libtcl$(echo $PKG_DEST | cut -d. -f-2).so + + make DESTDIR=$PKG_DEST install-private-headers + + ln $PKG_DEST/usr/bin/tclsh* $PKG_DEST/usr/bin/tclsh + cp -f tclsh9 $PKG_DEST/usr/bin/tclsh + mv $PKG_DEST/usr/share/man/man3/Thread.3 \ + $PKG_DEST/usr/share/man/man3/Tcl_Thread.3 + +} + + diff --git a/repo/system/tomlc99.xibuild b/repo/system/tomlc99.xibuild deleted file mode 100644 index 6387c96..0000000 --- a/repo/system/tomlc99.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make" -DEPS="musl" - -PKG_VER=1.0 -SOURCE=https://github.com/cktan/tomlc99.git -DESC="Library for parsing toml v1.0 compliant files, in c99" - -build () { - make -} - -package () { - mkdir -p $PKG_DEST/usr/lib - mkdir -p $PKG_DEST/usr/include - install toml.h $PKG_DEST/usr/include - install libtoml.so.$PKG_VER $PKG_DEST/usr/lib - ln -s libtoml.so.$PKG_VER $PKG_DEST/usr/lib/libtoml.so -} diff --git a/repo/system/tomlc99/tomlc99.xibuild b/repo/system/tomlc99/tomlc99.xibuild new file mode 100644 index 0000000..6387c96 --- /dev/null +++ b/repo/system/tomlc99/tomlc99.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make" +DEPS="musl" + +PKG_VER=1.0 +SOURCE=https://github.com/cktan/tomlc99.git +DESC="Library for parsing toml v1.0 compliant files, in c99" + +build () { + make +} + +package () { + mkdir -p $PKG_DEST/usr/lib + mkdir -p $PKG_DEST/usr/include + install toml.h $PKG_DEST/usr/include + install libtoml.so.$PKG_VER $PKG_DEST/usr/lib + ln -s libtoml.so.$PKG_VER $PKG_DEST/usr/lib/libtoml.so +} diff --git a/repo/system/tree-sitter.xibuild b/repo/system/tree-sitter.xibuild deleted file mode 100644 index ccd2b77..0000000 --- a/repo/system/tree-sitter.xibuild +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=0.20.6 -SOURCE=https://github.com/tree-sitter/tree-sitter/archive/v$PKG_VER/tree-sitter-$PKG_VER.tar.gz -DESC="Incremental parsing system for programming tools" - -prepare () { - cargo fetch --locked -} - -build () { - make - cargo build -p tree-sitter-cli --frozen --release -} - -package () { - make DESTDIR=$PKG_DEST PREFIX=/usr install - install -D -m755 target/release/tree-sitter $PKG_DEST/usr/bin/ -} diff --git a/repo/system/tree-sitter/tree-sitter.xibuild b/repo/system/tree-sitter/tree-sitter.xibuild new file mode 100644 index 0000000..ccd2b77 --- /dev/null +++ b/repo/system/tree-sitter/tree-sitter.xibuild @@ -0,0 +1,22 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=0.20.6 +SOURCE=https://github.com/tree-sitter/tree-sitter/archive/v$PKG_VER/tree-sitter-$PKG_VER.tar.gz +DESC="Incremental parsing system for programming tools" + +prepare () { + cargo fetch --locked +} + +build () { + make + cargo build -p tree-sitter-cli --frozen --release +} + +package () { + make DESTDIR=$PKG_DEST PREFIX=/usr install + install -D -m755 target/release/tree-sitter $PKG_DEST/usr/bin/ +} diff --git a/repo/system/tzdata.xibuild b/repo/system/tzdata.xibuild deleted file mode 100644 index 0813733..0000000 --- a/repo/system/tzdata.xibuild +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh - -NAME="tzdata" -DESC="Timezone data" - -MAKEDEPS="cmake " -DEPS="musl " - -PKG_VER=2022a -SOURCE="https://www.iana.org/time-zones/repository/releases/tzdata$PKG_VER.tar.gz" -tzcodever=2022a -ptzver=0.5 - -ADDITIONAL=" -https://www.iana.org/time-zones/repository/releases/tzcode$tzcodever.tar.gz -https://dev.alpinelinux.org/archive/posixtz/posixtz-$ptzver.tar.xz -0002-fix-implicit-declaration-warnings-by-including-strin.patch 0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch -" - -timezones="africa antarctica asia australasia europe northamerica \ - southamerica etcetera backward factory" - -prepare () { - tar xf tzcode$tzcodever.tar.gz - tar xf posixtz-$ptzver.tar.xz - apply_patches -} - - -build() { - make cc="${CC:-gcc}" CFLAGS="$CFLAGS -DHAVE_STDINT_H=1" - TZDIR="/usr/share/zoneinfo" - - cd posixtz-$ptzver - make posixtz - cd .. -} - -package () { - ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo $timezones - ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo/right -L leapseconds $timezones - - ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo -p America/New_York - install -m444 -t "$PKG_DEST"/usr/share/zoneinfo iso3166.tab zone1970.tab zone.tab - - mkdir -p "$PKG_DEST"/usr/sbin - install -m755 zic zdump "$PKG_DEST"/usr/sbin - - mkdir -p "$PKG_DEST"/usr/share/man/man8 - install -m644 zic.8 zdump.8 "$PKG_DEST"/usr/share/man/man8 - - rm -f "$PKG_DEST"/usr/share/zoneinfo/localtime - install -Dm755 posixtz-$ptzver/posixtz \ - "$PKG_DEST"/usr/bin/posixtz - -} diff --git a/repo/system/tzdata/0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch b/repo/system/tzdata/0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch new file mode 100644 index 0000000..c4ae70b --- /dev/null +++ b/repo/system/tzdata/0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch @@ -0,0 +1,27 @@ +From e6765bd363d2dd1dcaeeae5117cc25aae53fb944 Mon Sep 17 00:00:00 2001 +From: William Pitcock +Date: Thu, 28 Apr 2011 02:56:42 -0500 +Subject: [PATCH 1/2] posixtz: ensure the file offset we pass to lseek is off_t + +on 32-bit systems, sizeof(off_t) is 4, on 64-bit sizeof(off_t) is 8 +causing a word masking issue. +--- + posixtz.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/posixtz.c b/posixtz.c +index cddcb3e..972ca31 100644 +--- a/posixtz-0.5/posixtz.c ++++ b/posixtz-0.5/posixtz.c +@@ -36,7 +36,7 @@ char *posix_tz(const char *filename) + if (r != TZ_BUFLEN + || strncmp(buf, "TZif", 4) != 0 + || (unsigned char)buf[4] < 2 +- || lseek(fd, -TZ_BUFLEN, SEEK_END) < 0 ++ || lseek(fd, (off_t) -TZ_BUFLEN, SEEK_END) < 0 + ) + goto ERROR; + +-- +2.16.2 + diff --git a/repo/system/tzdata/0002-fix-implicit-declaration-warnings-by-including-strin.patch b/repo/system/tzdata/0002-fix-implicit-declaration-warnings-by-including-strin.patch new file mode 100644 index 0000000..6f61b25 --- /dev/null +++ b/repo/system/tzdata/0002-fix-implicit-declaration-warnings-by-including-strin.patch @@ -0,0 +1,28 @@ +From 89d4aece7ba679703060393ac95086fd514c7fc7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?S=C3=B6ren=20Tempel?= +Date: Tue, 27 Mar 2018 19:09:44 +0200 +Subject: [PATCH 2/2] fix implicit declaration warnings by including string.h + and unistd.h + +string.h is needed for strncmp(3) and unistd.h is needed for read(3), +close(3) and lseek(3). +--- + posixtz.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/posixtz.c b/posixtz.c +index 972ca31..4a36e10 100644 +--- a/posixtz-0.5/posixtz.c ++++ b/posixtz-0.5/posixtz.c +@@ -14,6 +14,8 @@ + #include + #include + #include ++#include ++#include + + #include "posixtz.h" + +-- +2.16.2 + diff --git a/repo/system/tzdata/tzdata.xibuild b/repo/system/tzdata/tzdata.xibuild new file mode 100644 index 0000000..0813733 --- /dev/null +++ b/repo/system/tzdata/tzdata.xibuild @@ -0,0 +1,56 @@ +#!/bin/sh + +NAME="tzdata" +DESC="Timezone data" + +MAKEDEPS="cmake " +DEPS="musl " + +PKG_VER=2022a +SOURCE="https://www.iana.org/time-zones/repository/releases/tzdata$PKG_VER.tar.gz" +tzcodever=2022a +ptzver=0.5 + +ADDITIONAL=" +https://www.iana.org/time-zones/repository/releases/tzcode$tzcodever.tar.gz +https://dev.alpinelinux.org/archive/posixtz/posixtz-$ptzver.tar.xz +0002-fix-implicit-declaration-warnings-by-including-strin.patch 0001-posixtz-ensure-the-file-offset-we-pass-to-lseek-is-o.patch +" + +timezones="africa antarctica asia australasia europe northamerica \ + southamerica etcetera backward factory" + +prepare () { + tar xf tzcode$tzcodever.tar.gz + tar xf posixtz-$ptzver.tar.xz + apply_patches +} + + +build() { + make cc="${CC:-gcc}" CFLAGS="$CFLAGS -DHAVE_STDINT_H=1" + TZDIR="/usr/share/zoneinfo" + + cd posixtz-$ptzver + make posixtz + cd .. +} + +package () { + ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo $timezones + ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo/right -L leapseconds $timezones + + ./zic -b fat -y ./yearistype -d "$PKG_DEST"/usr/share/zoneinfo -p America/New_York + install -m444 -t "$PKG_DEST"/usr/share/zoneinfo iso3166.tab zone1970.tab zone.tab + + mkdir -p "$PKG_DEST"/usr/sbin + install -m755 zic zdump "$PKG_DEST"/usr/sbin + + mkdir -p "$PKG_DEST"/usr/share/man/man8 + install -m644 zic.8 zdump.8 "$PKG_DEST"/usr/share/man/man8 + + rm -f "$PKG_DEST"/usr/share/zoneinfo/localtime + install -Dm755 posixtz-$ptzver/posixtz \ + "$PKG_DEST"/usr/bin/posixtz + +} diff --git a/repo/system/ubase.xibuild b/repo/system/ubase.xibuild deleted file mode 100644 index 0fd1258..0000000 --- a/repo/system/ubase.xibuild +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make findutils sed" -DEPS="musl" - -SOURCE=https://git.suckless.org/ubase - -DESC="ubase from suckless.org" - -prepare () { - /usr/bin/find -type 'f' -name '*.c' | xargs sed -i "s@#include @#include @g" -} - -build () { - make -} - -package () { - for p in stat id df dd truncate who; do - install -d $PKG_DEST/usr/bin - install -m755 $p $PKG_DEST/usr/bin - - if [ -f $p.1 ]; then - install -d $PKG_DEST/usr/share/man - install -m644 $p.1 $PKG_DEST/usr/share/man/$p.1 - fi - if [ -f $p.8 ]; then - install -d $PKG_DEST/usr/share/man - install -m644 $p.8 $PKG_DEST/usr/share/man/$p.8 - fi - done; -} diff --git a/repo/system/ubase/ubase.xibuild b/repo/system/ubase/ubase.xibuild new file mode 100644 index 0000000..0fd1258 --- /dev/null +++ b/repo/system/ubase/ubase.xibuild @@ -0,0 +1,32 @@ +#!/bin/sh + +MAKEDEPS="make findutils sed" +DEPS="musl" + +SOURCE=https://git.suckless.org/ubase + +DESC="ubase from suckless.org" + +prepare () { + /usr/bin/find -type 'f' -name '*.c' | xargs sed -i "s@#include @#include @g" +} + +build () { + make +} + +package () { + for p in stat id df dd truncate who; do + install -d $PKG_DEST/usr/bin + install -m755 $p $PKG_DEST/usr/bin + + if [ -f $p.1 ]; then + install -d $PKG_DEST/usr/share/man + install -m644 $p.1 $PKG_DEST/usr/share/man/$p.1 + fi + if [ -f $p.8 ]; then + install -d $PKG_DEST/usr/share/man + install -m644 $p.8 $PKG_DEST/usr/share/man/$p.8 + fi + done; +} diff --git a/repo/system/udev-rules.xibuild b/repo/system/udev-rules.xibuild deleted file mode 100644 index 9eda445..0000000 --- a/repo/system/udev-rules.xibuild +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="" - -SOURCE=https://xi.davidovski.xyz/git/bootscripts.git -DESC="udev rules for xilinux" - -package () { - cd udev - mkdir -p $PKG_DEST/usr/lib/udev/rules.d - mkdir -p $PKG_DEST/etc/udev/rules.d - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/udev-rules/udev-rules.xibuild b/repo/system/udev-rules/udev-rules.xibuild new file mode 100644 index 0000000..9eda445 --- /dev/null +++ b/repo/system/udev-rules/udev-rules.xibuild @@ -0,0 +1,14 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="" + +SOURCE=https://xi.davidovski.xyz/git/bootscripts.git +DESC="udev rules for xilinux" + +package () { + cd udev + mkdir -p $PKG_DEST/usr/lib/udev/rules.d + mkdir -p $PKG_DEST/etc/udev/rules.d + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/unibilium.xibuild b/repo/system/unibilium.xibuild deleted file mode 100644 index 9c170f7..0000000 --- a/repo/system/unibilium.xibuild +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=2.1.1 -SOURCE=https://github.com/neovim/unibilium/archive/v$PKG_VER.tar.gz -DESC="Terminfo parsing library" - -build () { - make PREFIX=/usr -} - -check () { - make test -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install -} diff --git a/repo/system/unibilium/unibilium.xibuild b/repo/system/unibilium/unibilium.xibuild new file mode 100644 index 0000000..9c170f7 --- /dev/null +++ b/repo/system/unibilium/unibilium.xibuild @@ -0,0 +1,20 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=2.1.1 +SOURCE=https://github.com/neovim/unibilium/archive/v$PKG_VER.tar.gz +DESC="Terminfo parsing library" + +build () { + make PREFIX=/usr +} + +check () { + make test +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install +} diff --git a/repo/system/utmps.xibuild b/repo/system/utmps.xibuild deleted file mode 100644 index 900aae8..0000000 --- a/repo/system/utmps.xibuild +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/sh - -MAKEDEPS="" -DEPS="skalibs" - -PKG_VER=0.1.1.0 -SOURCE=https://skarnet.org/software/utmps/utmps-$PKG_VER.tar.gz - -ADDITIONAL=" -btmpd.initd -btmpd.logrotate -utmpd.initd -utmp-init.initd -utmp-prepare.initd -wtmpd.initd -wtmpd.logrotate -" - -DESC="Library implementing utmpx.h family of functions" - -build () { - ./configure \ - --enable-shared \ - --libdir=/usr/lib \ - --with-dynlib=/lib \ - --libexecdir="/lib/utmps" \ - --with=dynlib=/lib - make -} - -package () { - make DESTDIR=$PKG_DEST install - ln -s utmps/utmpx.h $PKG_DEST/usr/include/utmpx.h - install -d $PKG_DEST/usr/lib/pkgconfig - cat > $PKG_DEST/usr/lib/pkgconfig/utmps.pc << EOF -Name: utmps -Description: A secure implementation of the utmp mechanism. -URL: https://skarnet.org/software/utmps/ -Version: $PKG_VER -Requires.private: skalibs -Libs: -lutmps -Cflags: -I/usr/include/utmps -EOF - install -D -m755 utmp-prepare.initd "$PKG_DEST/etc/init.d/utmp-prepare" - install -D -m755 utmpd.initd "$PKG_DEST/etc/init.d/utmpd" - install -D -m755 wtmpd.initd "$PKG_DEST/etc/init.d/wtmpd" - install -D -m755 btmpd.initd "$PKG_DEST/etc/init.d/btmpd" - install -D -m755 utmp-init.initd "$PKG_DEST/etc/init.d/utmp-init" - install -D -m644 wtmpd.logrotate "$PKG_DEST/etc/logrotate.d/wtmpd" - install -D -m644 btmpd.logrotate "$PKG_DEST/etc/logrotate.d/btmpd" -} - -postinstall () { - # check that shadow exists - command -v useradd || exit 1 - command -v chown || exit 1 - - grep -q "utmps" /etc/passwd || useradd -c "utmps user" -d /run/utmps \ - -u 984 -g utmp -s /bin/false utmp - [ -d /var/log/utmps ] || mkdir -p /var/log/utmps - [ -d /var/log/wtmp ] && mv /var/log/wtmp /var/log/utmps - chown -R utmp:utmp /var/log/utmps - [ -e /var/log/wtmp ] || ln -s utmps/wtmp /var/log/wtmp - -# utmps is broken, dont try to make services with it without s6 ipc -# rc-update add utmp-prepare boot -# rc-update add utmpd boot -# rc-update add wtmpd boot -# rc-update add btmpd boot -# rc-update add utmp-init boot -# rc-service utmp-prepare start -# rc-service utmpd start -# rc-service wtmpd start -# rc-service btmpd start -} diff --git a/repo/system/utmps/btmpd.initd b/repo/system/utmps/btmpd.initd new file mode 100644 index 0000000..b9acc72 --- /dev/null +++ b/repo/system/utmps/btmpd.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 2020-2021 Laurent Bercot for Alpine Linux +# Distributed under the terms of the ISC License. +# +name=btmpd +description="utmps daemon for the btmp service" + +command=/bin/s6-ipcserver +command_args="/run/utmps/.btmpd-socket utmps-wtmpd btmp" +command_user=utmp +command_background=yes +directory=/var/log/btmpd +pidfile=/run/utmps/btmpd.pid + +depend() { + need localmount utmp-prepare + after bootmisc + before networking +} + +start_pre() { + checkpath -d -o utmp:utmp -m 0755 /run/utmps + checkpath -d -o utmp:utmp -m 2755 /var/log/btmpd +} diff --git a/repo/system/utmps/btmpd.logrotate b/repo/system/utmps/btmpd.logrotate new file mode 100644 index 0000000..b681d90 --- /dev/null +++ b/repo/system/utmps/btmpd.logrotate @@ -0,0 +1,6 @@ +/var/log/btmpd/btmp { + missingok + monthly + create 0644 utmp utmp + rotate 3 +} diff --git a/repo/system/utmps/utmp-init.initd b/repo/system/utmps/utmp-init.initd new file mode 100644 index 0000000..acb4dbe --- /dev/null +++ b/repo/system/utmps/utmp-init.initd @@ -0,0 +1,21 @@ +#!/sbin/openrc-run +# Copyright 2020-2022 Laurent Bercot for Alpine Linux +# Distributed under the terms of the ISC License. +# +description="clearing and initialization of the utmp database" + +depend() { + need utmp-prepare utmpd wtmpd + before networking + after clock +} + +start() { + # Create an empty utmp file + checkpath -F -f -m 0644 -o utmp:utmp /run/utmps/utmp + + # Write the initial records as sysvinit/busybox init would do. + # 20018 = 256 * 'N' + '2'. Don't ask. + utmps-write -t 2000 -uw -l reboot -p 0 -h "$(uname -r)" -- '~~' BOOT_TIME '~' + utmps-write -t 2000 -uw -l runlevel -p 20018 -h "$(uname -r)" -- '~~' RUN_LVL '~' +} diff --git a/repo/system/utmps/utmp-prepare.initd b/repo/system/utmps/utmp-prepare.initd new file mode 100644 index 0000000..9f61249 --- /dev/null +++ b/repo/system/utmps/utmp-prepare.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# Copyright 2020-2022 Laurent Bercot for Alpine Linux +# Distributed under the terms of the ISC License. +# +description="preparation of the utmp databases" + +depend() { + before networking + after clock +} + +start() { + if ! test -L /var/log/utmp || test "$(readlink /var/log/utmp)" != /run/utmps/utmp ; then + rm -f /var/log/utmp + ln -s /run/utmps/utmp /var/log/utmp + fi + if ! test -L /var/log/wtmp || test "$(readlink /var/log/wtmp)" != wtmpd/wtmp ; then + rm -f /var/log/wtmp + ln -s wtmpd/wtmp /var/log/wtmp + fi + if ! test -L /var/log/btmp || test "$(readlink /var/log/btmp)" != btmpd/btmp ; then + rm -f /var/log/btmp + ln -s btmpd/btmp /var/log/btmp + fi +} diff --git a/repo/system/utmps/utmpd.initd b/repo/system/utmps/utmpd.initd new file mode 100644 index 0000000..d04c6b9 --- /dev/null +++ b/repo/system/utmps/utmpd.initd @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 2020-2021 Laurent Bercot for Alpine Linux +# Distributed under the terms of the ISC License. +# +name="utmpd" +description="utmps daemon for the utmp service" + +command=/bin/s6-ipcserver +command_args="/run/utmps/.utmpd-socket utmps-utmpd" +command_user=utmp +command_background=yes +directory=/run/utmps +pidfile=/run/utmps/utmpd.pid + +depend() { + need utmp-prepare + after bootmisc + before networking +} + +start_pre() { + checkpath -d -o utmp:utmp -m 0755 /run/utmps +} diff --git a/repo/system/utmps/utmps.xibuild b/repo/system/utmps/utmps.xibuild new file mode 100644 index 0000000..900aae8 --- /dev/null +++ b/repo/system/utmps/utmps.xibuild @@ -0,0 +1,75 @@ +#!/bin/sh + +MAKEDEPS="" +DEPS="skalibs" + +PKG_VER=0.1.1.0 +SOURCE=https://skarnet.org/software/utmps/utmps-$PKG_VER.tar.gz + +ADDITIONAL=" +btmpd.initd +btmpd.logrotate +utmpd.initd +utmp-init.initd +utmp-prepare.initd +wtmpd.initd +wtmpd.logrotate +" + +DESC="Library implementing utmpx.h family of functions" + +build () { + ./configure \ + --enable-shared \ + --libdir=/usr/lib \ + --with-dynlib=/lib \ + --libexecdir="/lib/utmps" \ + --with=dynlib=/lib + make +} + +package () { + make DESTDIR=$PKG_DEST install + ln -s utmps/utmpx.h $PKG_DEST/usr/include/utmpx.h + install -d $PKG_DEST/usr/lib/pkgconfig + cat > $PKG_DEST/usr/lib/pkgconfig/utmps.pc << EOF +Name: utmps +Description: A secure implementation of the utmp mechanism. +URL: https://skarnet.org/software/utmps/ +Version: $PKG_VER +Requires.private: skalibs +Libs: -lutmps +Cflags: -I/usr/include/utmps +EOF + install -D -m755 utmp-prepare.initd "$PKG_DEST/etc/init.d/utmp-prepare" + install -D -m755 utmpd.initd "$PKG_DEST/etc/init.d/utmpd" + install -D -m755 wtmpd.initd "$PKG_DEST/etc/init.d/wtmpd" + install -D -m755 btmpd.initd "$PKG_DEST/etc/init.d/btmpd" + install -D -m755 utmp-init.initd "$PKG_DEST/etc/init.d/utmp-init" + install -D -m644 wtmpd.logrotate "$PKG_DEST/etc/logrotate.d/wtmpd" + install -D -m644 btmpd.logrotate "$PKG_DEST/etc/logrotate.d/btmpd" +} + +postinstall () { + # check that shadow exists + command -v useradd || exit 1 + command -v chown || exit 1 + + grep -q "utmps" /etc/passwd || useradd -c "utmps user" -d /run/utmps \ + -u 984 -g utmp -s /bin/false utmp + [ -d /var/log/utmps ] || mkdir -p /var/log/utmps + [ -d /var/log/wtmp ] && mv /var/log/wtmp /var/log/utmps + chown -R utmp:utmp /var/log/utmps + [ -e /var/log/wtmp ] || ln -s utmps/wtmp /var/log/wtmp + +# utmps is broken, dont try to make services with it without s6 ipc +# rc-update add utmp-prepare boot +# rc-update add utmpd boot +# rc-update add wtmpd boot +# rc-update add btmpd boot +# rc-update add utmp-init boot +# rc-service utmp-prepare start +# rc-service utmpd start +# rc-service wtmpd start +# rc-service btmpd start +} diff --git a/repo/system/utmps/wtmpd.initd b/repo/system/utmps/wtmpd.initd new file mode 100644 index 0000000..8d3f624 --- /dev/null +++ b/repo/system/utmps/wtmpd.initd @@ -0,0 +1,24 @@ +#!/sbin/openrc-run +# Copyright 2020-2021 Laurent Bercot for Alpine Linux +# Distributed under the terms of the ISC License. +# +name=wtmpd +description="utmps daemon for the wtmp service" + +command=/bin/s6-ipcserver +command_args="/run/utmps/.wtmpd-socket utmps-wtmpd wtmp" +command_user=utmp +command_background=yes +directory=/var/log/wtmpd +pidfile=/run/utmps/wtmpd.pid + +depend() { + need localmount utmp-prepare + after bootmisc + before networking +} + +start_pre() { + checkpath -d -o utmp:utmp -m 0755 /run/utmps + checkpath -d -o utmp:utmp -m 2755 /var/log/wtmpd +} diff --git a/repo/system/utmps/wtmpd.logrotate b/repo/system/utmps/wtmpd.logrotate new file mode 100644 index 0000000..bb23536 --- /dev/null +++ b/repo/system/utmps/wtmpd.logrotate @@ -0,0 +1,6 @@ +/var/log/wtmpd/wtmp { + missingok + monthly + create 0644 utmp utmp + rotate 3 +} diff --git a/repo/system/xxhash.xibuild b/repo/system/xxhash.xibuild deleted file mode 100644 index 6691fd9..0000000 --- a/repo/system/xxhash.xibuild +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="sh" - -PKG_VER=0.8.1 -SOURCE=https://github.com/Cyan4973/xxHash/archive/refs/tags/v$PKG_VER.tar.gz -DESC="xxHash is an Extremely fast Hash algorithm" - - -build () { - make PREFIX=/usr -} - -package () { - make PREFIX=/usr DESTDIR=$PKG_DEST install -} - diff --git a/repo/system/xxhash/xxhash.xibuild b/repo/system/xxhash/xxhash.xibuild new file mode 100644 index 0000000..6691fd9 --- /dev/null +++ b/repo/system/xxhash/xxhash.xibuild @@ -0,0 +1,18 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="sh" + +PKG_VER=0.8.1 +SOURCE=https://github.com/Cyan4973/xxHash/archive/refs/tags/v$PKG_VER.tar.gz +DESC="xxHash is an Extremely fast Hash algorithm" + + +build () { + make PREFIX=/usr +} + +package () { + make PREFIX=/usr DESTDIR=$PKG_DEST install +} + diff --git a/repo/system/xz.xibuild b/repo/system/xz.xibuild deleted file mode 100644 index a1d4e17..0000000 --- a/repo/system/xz.xibuild +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="sh" - -PKG_VER=5.2.2 -SOURCE=https://github.com/xz-mirror/xz/releases/download/v$PKG_VER/xz-$PKG_VER.tar.xz -DESC="Tools for the lzma and xz compression formats" - - -build () { - ./autogen.sh - ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/xz-$PKG_VER - make -} - -check () { - make check -} - -package () { - make DESTDIR=$PKG_DEST install -} diff --git a/repo/system/xz/xz.xibuild b/repo/system/xz/xz.xibuild new file mode 100644 index 0000000..a1d4e17 --- /dev/null +++ b/repo/system/xz/xz.xibuild @@ -0,0 +1,23 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="sh" + +PKG_VER=5.2.2 +SOURCE=https://github.com/xz-mirror/xz/releases/download/v$PKG_VER/xz-$PKG_VER.tar.xz +DESC="Tools for the lzma and xz compression formats" + + +build () { + ./autogen.sh + ./configure --prefix=/usr --disable-static --docdir=/usr/share/doc/xz-$PKG_VER + make +} + +check () { + make check +} + +package () { + make DESTDIR=$PKG_DEST install +} diff --git a/repo/system/zip.xibuild b/repo/system/zip.xibuild deleted file mode 100644 index e356b10..0000000 --- a/repo/system/zip.xibuild +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl bzip2" - -PKG_VER=30 -SOURCE=https://downloads.sourceforge.net/infozip/zip$PKG_VER.tar.gz -DESC="Compressor/archiver for creating and modifying zipfiles" - -build () { - make -f unix/Makefile generic_gcc -} - -package () { - make -f unix/Makefile prefix=$PKG_DEST/usr install -} diff --git a/repo/system/zip/zip.xibuild b/repo/system/zip/zip.xibuild new file mode 100644 index 0000000..e356b10 --- /dev/null +++ b/repo/system/zip/zip.xibuild @@ -0,0 +1,16 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl bzip2" + +PKG_VER=30 +SOURCE=https://downloads.sourceforge.net/infozip/zip$PKG_VER.tar.gz +DESC="Compressor/archiver for creating and modifying zipfiles" + +build () { + make -f unix/Makefile generic_gcc +} + +package () { + make -f unix/Makefile prefix=$PKG_DEST/usr install +} diff --git a/repo/system/zlib.xibuild b/repo/system/zlib.xibuild deleted file mode 100644 index 15dbe59..0000000 --- a/repo/system/zlib.xibuild +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl" - -PKG_VER=1.2.11 -SOURCE=https://github.com/madler/zlib/archive/refs/tags/v$PKG_VER.tar.gz -DESC="compression and decompression routines used by some programs" - - -build () { - ./configure --prefix=/usr - make -} - -check () { - make check -} - -package () { - make DESTDIR=$PKG_DEST install - rm -f $PKG_DEST/usr/lib/libz.a -} - diff --git a/repo/system/zlib/zlib.xibuild b/repo/system/zlib/zlib.xibuild new file mode 100644 index 0000000..15dbe59 --- /dev/null +++ b/repo/system/zlib/zlib.xibuild @@ -0,0 +1,24 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl" + +PKG_VER=1.2.11 +SOURCE=https://github.com/madler/zlib/archive/refs/tags/v$PKG_VER.tar.gz +DESC="compression and decompression routines used by some programs" + + +build () { + ./configure --prefix=/usr + make +} + +check () { + make check +} + +package () { + make DESTDIR=$PKG_DEST install + rm -f $PKG_DEST/usr/lib/libz.a +} + diff --git a/repo/system/zstd.xibuild b/repo/system/zstd.xibuild deleted file mode 100644 index 827025e..0000000 --- a/repo/system/zstd.xibuild +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -MAKEDEPS="make " -DEPS="musl zlib xz lz4" - -PKG_VER=1.5.1 -SOURCE=https://github.com/facebook/zstd/releases/download/v$PKG_VER/zstd-$PKG_VER.tar.gz -DESC="the Zstandard real-time compression algorithm" - -build () { - make -} - -check () { - # fix these tests to work - make check || true -} - -package () { - make prefix=$PKG_DEST/usr install -} diff --git a/repo/system/zstd/zstd.xibuild b/repo/system/zstd/zstd.xibuild new file mode 100644 index 0000000..827025e --- /dev/null +++ b/repo/system/zstd/zstd.xibuild @@ -0,0 +1,21 @@ +#!/bin/sh + +MAKEDEPS="make " +DEPS="musl zlib xz lz4" + +PKG_VER=1.5.1 +SOURCE=https://github.com/facebook/zstd/releases/download/v$PKG_VER/zstd-$PKG_VER.tar.gz +DESC="the Zstandard real-time compression algorithm" + +build () { + make +} + +check () { + # fix these tests to work + make check || true +} + +package () { + make prefix=$PKG_DEST/usr install +} -- cgit v1.2.1