├── .gitignore ├── LICENSE ├── README.md ├── adapters.nix ├── aliases.nix ├── booter.nix ├── build-support ├── bintools-wrapper │ ├── add-darwin-ldflags-before.sh │ ├── add-flags.sh │ ├── add-hardening.sh │ ├── darwin-install_name_tool-wrapper.sh │ ├── darwin-strip-wrapper.sh │ ├── default.nix │ ├── gnu-binutils-strip-wrapper.sh │ ├── ld-solaris-wrapper.sh │ ├── ld-wrapper.sh │ ├── macos-sierra-reexport-hack.bash │ └── setup-hook.sh ├── cc-wrapper │ ├── add-clang-cc-cflags-before.sh │ ├── add-flags.sh │ ├── add-gnat-extra-flags.sh │ ├── add-hardening.sh │ ├── cc-wrapper.sh │ ├── default.nix │ ├── fortran-hook.sh │ ├── gnat-wrapper.sh │ ├── go-wrapper.sh │ └── setup-hook.sh ├── expand-response-params │ ├── default.nix │ └── expand-response-params.c ├── fetchgithub │ └── default.nix ├── fetchpatch │ ├── default.nix │ └── tests.nix ├── fetchurl │ ├── boot.nix │ ├── builder.sh │ ├── default.nix │ ├── mirrors.nix │ ├── tests.nix │ └── write-mirror-list.sh ├── lib │ ├── cmake.nix │ └── meson.nix ├── nuke-references │ ├── darwin-sign-fixup.sh │ ├── default.nix │ └── nuke-refs.sh ├── setup-hooks │ ├── audit-tmpdir.sh │ ├── auto-patchelf.py │ ├── auto-patchelf.sh │ ├── autoreconf.sh │ ├── breakpoint-hook.sh │ ├── compress-man-pages.sh │ ├── copy-desktop-items.sh │ ├── copy-pkgconfig-items.sh │ ├── desktop-to-darwin-bundle.sh │ ├── die.sh │ ├── enable-coverage-instrumentation.sh │ ├── find-xml-catalogs.sh │ ├── fix-darwin-dylib-names.sh │ ├── gog-unpack.sh │ ├── install-shell-files.sh │ ├── keep-build-tree.sh │ ├── ld-is-cc-hook.sh │ ├── make-binary-wrapper │ │ ├── default.nix │ │ └── make-binary-wrapper.sh │ ├── make-coverage-analysis-report.sh │ ├── make-symlinks-relative.sh │ ├── make-wrapper.sh │ ├── move-build-tree.sh │ ├── move-docs.sh │ ├── move-lib64.sh │ ├── move-sbin.sh │ ├── move-systemd-user-units.sh │ ├── mpi-check-hook │ │ ├── default.nix │ │ └── mpi-check-hook.sh │ ├── multiple-outputs.sh │ ├── patch-ppd-files │ │ ├── default.nix │ │ ├── patch-ppd-hook.sh │ │ ├── patch-ppd-lines.awk │ │ ├── test.nix │ │ └── test.ppd │ ├── patch-rc-path-hooks │ │ ├── default.nix │ │ ├── patch-rc-path-bash.sh │ │ ├── patch-rc-path-csh.sh │ │ ├── patch-rc-path-fish.sh │ │ ├── patch-rc-path-posix.sh │ │ └── test │ │ │ ├── default.nix │ │ │ ├── sample_source.bash │ │ │ ├── sample_source.csh.in │ │ │ ├── sample_source.fish │ │ │ ├── sample_source.sh.in │ │ │ ├── test-sourcing-bash │ │ │ ├── test-sourcing-csh │ │ │ ├── test-sourcing-fish │ │ │ └── test-sourcing-posix │ ├── patch-shebangs.sh │ ├── postgresql-test-hook │ │ ├── default.nix │ │ ├── postgresql-test-hook.sh │ │ └── test.nix │ ├── prune-libtool-files.sh │ ├── reproducible-builds.sh │ ├── role.bash │ ├── separate-debug-info.sh │ ├── set-java-classpath.sh │ ├── set-source-date-epoch-to-latest.sh │ ├── setup-debug-info-dirs.sh │ ├── shorten-perl-shebang.sh │ ├── strip-java-archives.sh │ ├── strip.sh │ ├── update-autotools-gnu-config-scripts.sh │ ├── use-old-cxx-abi.sh │ ├── validate-pkg-config.sh │ ├── win-dll-link.sh │ └── wrap-gapps-hook │ │ ├── default.nix │ │ ├── tests │ │ ├── lib.nix │ │ └── sample-project │ │ │ └── Makefile │ │ └── wrap-gapps-hook.sh ├── testers │ ├── default.nix │ ├── expect-failure.sh │ ├── hasPkgConfigModules │ │ ├── tester.nix │ │ └── tests.nix │ ├── lychee.nix │ ├── shellcheck │ │ ├── example.sh │ │ ├── tester.nix │ │ └── tests.nix │ ├── test-equal-derivation.nix │ ├── test │ │ ├── README.md │ │ └── default.nix │ └── testMetaPkgConfig │ │ └── tester.nix ├── trivial-builders │ ├── default.nix │ ├── test-overriding.nix │ └── test │ │ ├── concat-test.nix │ │ ├── default.nix │ │ ├── link-farm.nix │ │ ├── references │ │ ├── apath.txt │ │ ├── default.nix │ │ ├── references-test.sh │ │ └── samples.nix │ │ ├── write-shell-script.nix │ │ ├── write-text-file.nix │ │ ├── writeCBin.nix │ │ ├── writeClosure-union.nix │ │ ├── writeScriptBin.nix │ │ ├── writeShellApplication.nix │ │ ├── writeShellScriptBin.nix │ │ └── writeStringReferencesToFile.nix └── wrapper-common │ └── utils.bash ├── config.nix ├── cross └── default.nix ├── custom └── default.nix ├── cygwin ├── all-buildinputs-as-runtimedep.sh ├── rebase-i686.sh ├── rebase-x86_64.sh └── wrap-exes-to-find-dlls.sh ├── darwin ├── README.md ├── bootstrap-files │ ├── aarch64-apple-darwin.nix │ └── x86_64-apple-darwin.nix ├── bootstrap-tools.nix ├── default.nix ├── make-bootstrap-tools.nix ├── override-sdk.nix ├── portable-libsystem.sh ├── stdenv-bootstrap-tools.nix └── test-bootstrap-tools.nix ├── default.nix ├── freebsd ├── always-patchelf.sh ├── bootstrap-files │ └── x86_64-unknown-freebsd.nix ├── bootstrap-tools-spurious.txt ├── default.nix ├── linkBootstrap.sh ├── make-bootstrap-tools-cross.nix ├── make-bootstrap-tools.nix ├── unpack-bootstrap-files.sh └── unpack-source.sh ├── generic ├── builder.sh ├── check-meta.nix ├── common-path.nix ├── default-builder.sh ├── default.nix ├── make-derivation.nix ├── meta-types.nix └── setup.sh ├── lib.nix ├── linux ├── bootstrap-files │ ├── aarch64-unknown-linux-gnu.nix │ ├── aarch64-unknown-linux-musl.nix │ ├── armv5tel-unknown-linux-gnueabi.nix │ ├── armv6l-unknown-linux-gnueabihf.nix │ ├── armv6l-unknown-linux-musleabihf.nix │ ├── armv7l-unknown-linux-gnueabihf.nix │ ├── i686-unknown-linux-gnu.nix │ ├── mips64el-unknown-linux-gnuabi64.nix │ ├── mips64el-unknown-linux-gnuabin32.nix │ ├── mipsel-unknown-linux-gnu.nix │ ├── powerpc64-unknown-linux-gnuabielfv2.nix │ ├── powerpc64le-unknown-linux-gnu.nix │ ├── riscv64-unknown-linux-gnu.nix │ ├── s390x-unknown-linux-gnu.nix │ ├── x86_64-unknown-linux-gnu.nix │ └── x86_64-unknown-linux-musl.nix ├── bootstrap-tools │ ├── default.nix │ ├── glibc.nix │ ├── glibc │ │ └── unpack-bootstrap-tools.sh │ ├── musl.nix │ └── musl │ │ └── unpack-bootstrap-tools.sh ├── default.nix ├── make-bootstrap-tools-cross.nix ├── make-bootstrap-tools.nix ├── stdenv-bootstrap-tools.nix └── test-bootstrap-tools.nix ├── native └── default.nix ├── nix └── default.nix ├── os-specific └── linux │ └── kernel-headers │ ├── default.nix │ └── no-relocs.patch ├── pkgs ├── acl │ └── default.nix ├── aliases.nix ├── attr │ └── default.nix ├── autoconf-archive │ └── default.nix ├── autoconf │ ├── 269.nix │ └── default.nix ├── automake │ ├── automake-1.11.x.nix │ ├── automake-1.15.x.nix │ ├── automake-1.16.x.nix │ ├── automake-1.17.x.nix │ ├── builder.sh │ ├── default.nix │ ├── fix-perl-5.26.patch │ ├── fix-test-autoconf-2.69.patch │ ├── help2man-SOURCE_DATE_EPOCH-support.patch │ └── setup-hook.sh ├── bash │ ├── 5.nix │ ├── bash-5.2-patches.nix │ ├── bash-completion │ │ └── default.nix │ ├── blesh │ │ └── default.nix │ ├── fix-pop-var-context-error.patch │ ├── fzf-obc │ │ └── default.nix │ ├── nix-bash-completions │ │ └── default.nix │ ├── parallel.patch │ ├── pgrp-pipe-5.patch │ ├── undistract-me │ │ └── default.nix │ ├── update-patch-set.sh │ └── yarn-completion │ │ └── default.nix ├── binutils │ ├── 0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch │ ├── 0001-Revert-libtool.m4-fix-the-NM-nm-over-here-B-option-w.patch │ ├── 0001-libtool.m4-update-macos-version-detection-block.patch │ ├── 2.38 │ │ ├── 0001-Revert-libtool.m4-fix-nm-BSD-flag-detection.patch │ │ ├── 0001-libtool.m4-update-macos-version-detection-block.patch │ │ ├── always-search-rpath.patch │ │ ├── build-components-separately.patch │ │ ├── default.nix │ │ ├── deterministic-temp-prefixes.patch │ │ ├── deterministic.patch │ │ ├── libbfd.nix │ │ ├── libopcodes.nix │ │ ├── mips64-default-n64.patch │ │ ├── ppc-make-machine-less-strict.patch │ │ ├── support-ios.patch │ │ └── windres-locate-gcc.patch │ ├── always-search-rpath.patch │ ├── avr-size.patch │ ├── default.nix │ ├── deterministic.patch │ ├── gold-powerpc-for-llvm.patch │ ├── libbfd.nix │ ├── libopcodes.nix │ ├── plugins-no-BINDIR.patch │ ├── ppc-make-machine-less-strict.patch │ ├── support-ios.patch │ └── windres-locate-gcc.patch ├── bison │ └── default.nix ├── bzip2 │ ├── 1_1.nix │ └── default.nix ├── coreutils │ ├── default.nix │ ├── fix-mix-flags-deps-libintl.patch │ └── fix-test-failure-musl.patch ├── db │ ├── CVE-2017-10140-4.8-cwd-db_config.patch │ ├── CVE-2017-10140-cwd-db_config.patch │ ├── clang-4.8.patch │ ├── clang-5.3.patch │ ├── clang-6.0.patch │ ├── darwin-mutexes-4.8.patch │ ├── darwin-mutexes.patch │ ├── db-4.8.nix │ ├── db-5.3.nix │ ├── db-6.0.nix │ ├── db-6.2.nix │ └── generic.nix ├── default.nix ├── diffutils │ └── default.nix ├── expat │ └── default.nix ├── file │ ├── 32-bit-time_t.patch │ └── default.nix ├── findutils │ ├── default.nix │ └── no-install-statedir.patch ├── flex │ └── default.nix ├── gawk │ ├── default.nix │ ├── fix-typos-corrected-in-libharu-2.4.4.patch │ ├── gawk-with-extensions.nix │ ├── gawkextlib.nix │ └── setup-hook.sh ├── gcc │ ├── all.nix │ ├── common │ │ ├── builder.nix │ │ ├── checksum.nix │ │ ├── configure-flags.nix │ │ ├── dependencies.nix │ │ ├── extra-target-flags.nix │ │ ├── libgcc-buildstuff.nix │ │ ├── libgcc.nix │ │ ├── meta.nix │ │ ├── platform-flags.nix │ │ ├── pre-configure.nix │ │ └── strip-attributes.nix │ ├── default.nix │ ├── patches │ │ ├── 6 │ │ │ ├── 0001-Fix-build-for-glibc-2.31.patch │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ ├── AvailabilityInternal.h-fixincludes.patch │ │ │ ├── gnat-glibc234.patch │ │ │ ├── gogcc-workaround-glibc-2.36.patch │ │ │ └── libstdc++-disable-flat_namespace.patch │ │ ├── 7 │ │ │ ├── 0001-Fix-build-for-glibc-2.31.patch │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ ├── AvailabilityInternal.h-fixincludes.patch │ │ │ ├── gcc8-asan-glibc-2.34.patch │ │ │ ├── riscv-no-relax.patch │ │ │ └── riscv-pthread-reentrant.patch │ │ ├── 8 │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ ├── AvailabilityInternal.h-fixincludes.patch │ │ │ ├── avr-gcc-8-darwin.patch │ │ │ └── gcc8-darwin-as-gstabs.patch │ │ ├── 9 │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ ├── AvailabilityInternal.h-fixincludes.patch │ │ │ ├── fix-struct-redefinition-on-glibc-2.36.patch │ │ │ └── gcc9-darwin-as-gstabs.patch │ │ ├── 10 │ │ │ └── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ ├── 11 │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ ├── gcc-issue-103910.patch │ │ │ └── libgcc-aarch64-darwin-detection.patch │ │ ├── 12 │ │ │ ├── Added-mcf-thread-model-support-from-mcfgthread.patch │ │ │ └── mangle-NIX_STORE-in-__FILE__.patch │ │ ├── 13 │ │ │ ├── mangle-NIX_STORE-in-__FILE__.patch │ │ │ └── no-sys-dirs-riscv.patch │ │ ├── 14 │ │ │ ├── gcc-darwin-remove-coreservices.patch │ │ │ ├── gnat-darwin-dylib-install-name-14.patch │ │ │ └── libgcc-darwin-detection.patch │ │ ├── 4.9 │ │ │ ├── darwin-clang-as.patch │ │ │ ├── libsanitizer.patch │ │ │ └── parallel-strsignal.patch │ │ ├── ada-cctools-as-detection-configure.patch │ │ ├── clang-genconditions.patch │ │ ├── default.nix │ │ ├── fix-bug-80431.patch │ │ ├── gcc-12-gfortran-driving.patch │ │ ├── gcc-12-no-sys-dirs.patch │ │ ├── gfortran-darwin-NXConstStr.patch │ │ ├── gfortran-driving.patch │ │ ├── gnat-cflags-11.patch │ │ ├── gnat-cflags.patch │ │ ├── gnat-darwin-dylib-install-name-13.patch │ │ ├── gnat-darwin-dylib-install-name.patch │ │ ├── libgomp-dont-force-initial-exec.patch │ │ ├── libphobos.patch │ │ ├── libsanitizer-no-cyclades-9.patch │ │ ├── libstdc++-netbsd-ctypes.patch │ │ ├── libstdc++-target.patch │ │ ├── no-sys-dirs-riscv-gcc9.patch │ │ ├── no-sys-dirs-riscv.patch │ │ ├── no-sys-dirs.patch │ │ ├── parallel-bconfig.patch │ │ ├── ppc-musl.patch │ │ ├── res_state-not-declared.patch │ │ ├── sigsegv-not-declared.patch │ │ ├── struct-sigaltstack-4.9.patch │ │ ├── struct-ucontext-4.8.patch │ │ ├── struct-ucontext.patch │ │ ├── update-mcfgthread-patches.sh │ │ └── use-source-date-epoch.patch │ └── versions.nix ├── gettext │ ├── 0001-msginit-Do-not-use-POT-Creation-Date.patch │ ├── absolute-paths.diff │ ├── default.nix │ └── gettext-setup-hook.sh ├── glibc │ ├── 0001-Revert-Remove-all-usage-of-BASH-or-BASH-in-installed.patch │ ├── 0001-aarch64-math-vector.h-add-NVCC-include-guard.patch │ ├── 2.39-master.patch │ ├── 2.39-revert-cet-default-disable.patch │ ├── common.nix │ ├── darwin-cross-build.patch │ ├── default.nix │ ├── dont-use-system-ld-so-cache.patch │ ├── dont-use-system-ld-so-preload.patch │ ├── fix-rpc-types-musl-conflicts.patch │ ├── fix-x64-abi.patch │ ├── fix_path_attribute_in_getconf.patch │ ├── info.nix │ ├── locales-builder.sh │ ├── locales.nix │ ├── mtrace.nix │ ├── multi.nix │ ├── nix-locale-archive.patch │ ├── nix-nss-open-files.patch │ └── reenable_DT_HASH.patch ├── gmp │ ├── 4.3.2.nix │ ├── 5.1.3-CVE-2021-43618.patch │ ├── 5.1.x.nix │ ├── 6.x.nix │ └── need-size-t.patch ├── gnu-config │ └── default.nix ├── gnugrep │ └── default.nix ├── gnulib │ ├── default.nix │ └── gnulib-longdouble-redirect.patch ├── gnum4 │ ├── default.nix │ └── loong-fix-build.patch ├── gnumake │ ├── 0001-No-impure-bin-sh.patch │ ├── 0002-remove-impure-dirs.patch │ ├── 4.2 │ │ ├── default.nix │ │ ├── glibc-2.27-glob.patch │ │ ├── glibc-2.33-glob.patch │ │ ├── impure-dirs.patch │ │ └── pselect.patch │ └── default.nix ├── gnupatch │ ├── Allow_input_files_to_be_missing_for_ed-style_patches.patch │ ├── CVE-2018-1000156.patch │ ├── CVE-2018-6951.patch │ ├── CVE-2018-6952.patch │ ├── CVE-2019-13636.patch │ ├── CVE-2019-13638-and-CVE-2018-20969.patch │ └── default.nix ├── gnused │ └── default.nix ├── gnutar │ └── default.nix ├── gzip │ └── default.nix ├── isl │ ├── 0.11.1.nix │ ├── 0.14.1.nix │ ├── 0.17.1.nix │ ├── 0.20.0.nix │ ├── 0.24.0.nix │ ├── fix-gcc-build.diff │ └── generic.nix ├── libffi │ ├── 3.3.nix │ └── default.nix ├── libidn2 │ ├── default.nix │ └── no-bootstrap-reference.nix ├── libmpc │ └── default.nix ├── libtool │ ├── default.nix │ └── libtool2.nix ├── libunistring │ └── default.nix ├── libxcrypt │ ├── check_passthru_matches.py │ └── default.nix ├── lndir │ ├── builder.sh │ └── default.nix ├── minizip │ └── default.nix ├── mpdecimal │ └── default.nix ├── mpfr │ └── default.nix ├── patchelf │ ├── default.nix │ ├── setup-hook.sh │ └── unstable.nix ├── pcre2 │ └── default.nix ├── perl │ ├── cpp-precomp.patch │ ├── cross.patch │ ├── default.nix │ ├── http-tiny-verify-ssl-by-default.patch │ ├── interpreter.nix │ ├── ld-shared.patch │ ├── no-sys-dirs-5.31.patch │ ├── no-sys-dirs-5.38.0.patch │ ├── setup-hook-cross.sh │ ├── setup-hook.sh │ ├── sw_vers.patch │ └── wrapper.nix ├── pkg-config │ ├── 2.36.3-not-win32.patch │ ├── default.nix │ └── requires-private.patch ├── python │ ├── catch_conflicts │ │ ├── README.md │ │ ├── catch_conflicts.py │ │ └── catch_conflicts_py2.py │ ├── conda │ │ └── default.nix │ ├── cpython │ │ ├── 2.7 │ │ │ ├── 2.5.2-ctypes-util-find_library.patch │ │ │ ├── 2.5.2-tkinter-x11.patch │ │ │ ├── 2.6.2-ssl-threads.patch │ │ │ ├── 2.6.5-FD_SETSIZE.patch │ │ │ ├── 2.6.5-export-PySignal_SetWakeupFd.patch │ │ │ ├── 2.6.5-ncurses-abi6.patch │ │ │ ├── 2.7.3-dbm.patch │ │ │ ├── 2.7.3-dylib.patch │ │ │ ├── 2.7.3-getpath-exe-extension.patch │ │ │ ├── 2.7.3-no-libm.patch │ │ │ ├── atomic_pyc.patch │ │ │ ├── cross-compile.patch │ │ │ ├── default.nix │ │ │ ├── deterministic-build.patch │ │ │ ├── find_library-gcc10.patch │ │ │ ├── nix-store-mtime.patch │ │ │ ├── no-ldconfig.patch │ │ │ ├── profile-task.patch │ │ │ ├── python-2.7-distutils-C++.patch │ │ │ ├── search-path.patch │ │ │ └── use-correct-tcl-tk-on-darwin.patch │ │ ├── 3.10 │ │ │ └── no-ldconfig.patch │ │ ├── 3.11 │ │ │ ├── darwin-libutil.patch │ │ │ ├── no-ldconfig.patch │ │ │ └── python-3.x-distutils-C++.patch │ │ ├── 3.12 │ │ │ ├── 0001-Fix-build-with-_PY_SHORT_FLOAT_REPR-0.patch │ │ │ └── no-ldconfig.patch │ │ ├── 3.13 │ │ │ ├── no-ldconfig.patch │ │ │ └── virtualenv-permissions.patch │ │ ├── 3.7 │ │ │ ├── darwin-libutil.patch │ │ │ ├── fix-finding-headers-when-cross-compiling.patch │ │ │ ├── no-win64-workaround.patch │ │ │ └── python-3.x-distutils-C++.patch │ │ ├── 3.8 │ │ │ ├── 0001-On-all-posix-systems-not-just-Darwin-set-LDSHARED-if.patch │ │ │ └── no-ldconfig.patch │ │ ├── 3.9 │ │ │ ├── darwin-tcl-tk.patch │ │ │ └── no-ldconfig.patch │ │ ├── default.nix │ │ ├── docs │ │ │ ├── 2.7-html.nix │ │ │ ├── 2.7-pdf-a4.nix │ │ │ ├── 2.7-pdf-letter.nix │ │ │ ├── 2.7-text.nix │ │ │ ├── 3.10-html.nix │ │ │ ├── 3.10-pdf-a4.nix │ │ │ ├── 3.10-pdf-letter.nix │ │ │ ├── 3.10-texinfo.nix │ │ │ ├── 3.10-text.nix │ │ │ ├── default.nix │ │ │ ├── generate.sh │ │ │ ├── template-info.nix │ │ │ └── template.nix │ │ ├── freebsd-cross.patch │ │ ├── loongarch-support.patch │ │ ├── mimetypes.patch │ │ ├── platform-triplet-detection.patch │ │ └── virtualenv-permissions.patch │ ├── default.nix │ ├── hooks │ │ ├── conda-install-hook.sh │ │ ├── conda-unpack-hook.sh │ │ ├── default.nix │ │ ├── egg-build-hook.sh │ │ ├── egg-install-hook.sh │ │ ├── egg-unpack-hook.sh │ │ ├── pip-build-hook.sh │ │ ├── pip-install-hook.sh │ │ ├── pypa-build-hook-test.nix │ │ ├── pypa-build-hook.sh │ │ ├── pypa-install-hook.sh │ │ ├── pytest-check-hook.sh │ │ ├── python-catch-conflicts-hook-tests.nix │ │ ├── python-catch-conflicts-hook.sh │ │ ├── python-imports-check-hook.sh │ │ ├── python-namespaces-hook.sh │ │ ├── python-output-dist-hook.sh │ │ ├── python-recompile-bytecode-hook.sh │ │ ├── python-relax-deps-hook.sh │ │ ├── python-remove-bin-bytecode-hook.sh │ │ ├── python-remove-tests-dir-hook.sh │ │ ├── python-runtime-deps-check-hook.py │ │ ├── python-runtime-deps-check-hook.sh │ │ ├── setuptools-build-hook.sh │ │ ├── setuptools-rust-hook.sh │ │ ├── sphinx-hook.sh │ │ ├── unittest-check-hook.sh │ │ ├── venv-shell-hook.sh │ │ └── wheel-unpack-hook.sh │ ├── manylinux │ │ └── default.nix │ ├── meta-package.nix │ ├── mk-python-derivation.nix │ ├── passthrufun.nix │ ├── pypy │ │ ├── default.nix │ │ ├── dont_fetch_vendored_deps.patch │ │ ├── prebuilt.nix │ │ ├── prebuilt_2_7.nix │ │ ├── sqlite_paths.patch │ │ └── tk_tcl_paths.patch │ ├── python-packages-base.nix │ ├── python2 │ │ └── mk-python-derivation.nix │ ├── run_setup.py │ ├── rustpython │ │ ├── Cargo.lock │ │ └── default.nix │ ├── setup-hook.nix │ ├── setup-hook.sh │ ├── sitecustomize.py │ ├── tests.nix │ ├── tests │ │ ├── test_cpython_gdb │ │ │ └── default.nix │ │ ├── test_environments │ │ │ └── test_python.py │ │ ├── test_nix_pythonprefix │ │ │ ├── default.nix │ │ │ └── typeddep │ │ │ │ ├── default.nix │ │ │ │ ├── setup.py │ │ │ │ └── typeddep │ │ │ │ ├── __init__.py │ │ │ │ ├── py.typed │ │ │ │ └── util.py │ │ └── test_tkinter │ │ │ └── default.nix │ ├── update-python-libraries │ │ ├── default.nix │ │ └── update-python-libraries.py │ ├── with-packages.nix │ ├── wrap-python.nix │ ├── wrap.sh │ └── wrapper.nix ├── readline │ ├── 7.0.nix │ ├── 8.2.nix │ ├── link-against-ncurses.patch │ ├── no-arch_only-6.3.patch │ ├── no-arch_only-8.2.patch │ ├── readline-7.0-patches.nix │ ├── readline-8.2-patches.nix │ └── update-patch-set.sh ├── setup-hooks │ └── update-autotools-gnu-config-scripts.sh ├── stdenv │ └── default.nix ├── texinfo │ ├── common.nix │ ├── cross-tools-flags.patch │ ├── fix-glibc-2.34.patch │ └── packages.nix ├── which │ └── default.nix ├── xz │ └── default.nix └── zlib │ └── default.nix ├── pure.nix ├── release.nix ├── release └── lib.nix ├── splice.nix ├── stage.nix ├── stdenv.nix ├── systems ├── architectures.nix ├── default.nix ├── doubles.nix ├── examples.nix ├── flake-systems.nix ├── inspect.nix ├── parse.nix └── platforms.nix └── tests └── succeedOnFailure.nix /.gitignore: -------------------------------------------------------------------------------- 1 | result* 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2003-2024 Eelco Dolstra and the Nixpkgs/NixOS contributors 4 | Copyright (c) 2024 Jonathan Ringer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Minimal stdenv 2 | 3 | This repo is meant to encapsulate all the logic around stdenv, spliced packages, 4 | and construction of a package set given additional overlays. 5 | 6 | The desire is for this to be the base on which larger nix package sets build upon. 7 | 8 | ## Changes from upstream Nixpkgs 9 | 10 | - `stdenv.isCross` is now defined 11 | 12 | ## Status 13 | 14 | Stdenv's supported: 15 | 16 | - [x] x86_64-linux 17 | - [ ] aarch64-linux 18 | - [ ] aarch64-darwin 19 | 20 | ## Testing 21 | 22 | `default.nix` is meant to be treated in a similar fashion to nixpkgs so, `nix-build` 23 | and `nix repl` workflows should translate to this repo as well: 24 | 25 | ``` 26 | nix-build -A stdenv 27 | /nix/store/lk2ax3a6mqrm5ddkg3s4f31m33w89k85-stdenv-linux 28 | ``` 29 | -------------------------------------------------------------------------------- /aliases.nix: -------------------------------------------------------------------------------- 1 | final: prev: let 2 | lib = final.prev; 3 | in { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /build-support/bintools-wrapper/add-flags.sh: -------------------------------------------------------------------------------- 1 | # See cc-wrapper for comments. 2 | var_templates_list=( 3 | NIX_IGNORE_LD_THROUGH_GCC 4 | NIX_LDFLAGS 5 | NIX_LDFLAGS_BEFORE 6 | NIX_DYNAMIC_LINKER 7 | NIX_LDFLAGS_AFTER 8 | NIX_LDFLAGS_HARDEN 9 | NIX_HARDENING_ENABLE 10 | ) 11 | var_templates_bool=( 12 | NIX_SET_BUILD_ID 13 | NIX_DONT_SET_RPATH 14 | ) 15 | 16 | accumulateRoles 17 | 18 | for var in "${var_templates_list[@]}"; do 19 | mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"} 20 | done 21 | for var in "${var_templates_bool[@]}"; do 22 | mangleVarBool "$var" ${role_suffixes[@]+"${role_suffixes[@]}"} 23 | done 24 | 25 | if [ -e @out@/nix-support/libc-ldflags ]; then 26 | NIX_LDFLAGS_@suffixSalt@+=" $(< @out@/nix-support/libc-ldflags)" 27 | fi 28 | 29 | if [ -z "$NIX_DYNAMIC_LINKER_@suffixSalt@" ] && [ -e @out@/nix-support/ld-set-dynamic-linker ]; then 30 | NIX_DYNAMIC_LINKER_@suffixSalt@="$(< @out@/nix-support/dynamic-linker)" 31 | fi 32 | 33 | if [ -e @out@/nix-support/libc-ldflags-before ]; then 34 | NIX_LDFLAGS_BEFORE_@suffixSalt@="$(< @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE_@suffixSalt@" 35 | fi 36 | 37 | export NIX_BINTOOLS_WRAPPER_FLAGS_SET_@suffixSalt@=1 38 | -------------------------------------------------------------------------------- /build-support/bintools-wrapper/gnu-binutils-strip-wrapper.sh: -------------------------------------------------------------------------------- 1 | #! @shell@ 2 | # shellcheck shell=bash 3 | 4 | exec @prog@ --enable-deterministic-archives "$@" 5 | -------------------------------------------------------------------------------- /build-support/bintools-wrapper/ld-solaris-wrapper.sh: -------------------------------------------------------------------------------- 1 | #!@shell@ 2 | set -eu -o pipefail 3 | shopt -s nullglob 4 | 5 | if (( "${NIX_DEBUG:-0}" >= 7 )); then 6 | set -x 7 | fi 8 | 9 | declare -a args=("$@") 10 | # I've also tried adding -z direct and -z lazyload, but it gave too many problems with C++ exceptions :'( 11 | # Also made sure libgcc would not be lazy-loaded, as suggested here: https://www.illumos.org/issues/2534#note-3 12 | # but still no success. 13 | declare -a argsBefore=(-z ignore) argsAfter=() 14 | 15 | # This loop makes sure all -L arguments are before -l arguments, or ld may complain it cannot find a library. 16 | # GNU binutils does not have this problem: 17 | # http://stackoverflow.com/questions/5817269/does-the-order-of-l-and-l-options-in-the-gnu-linker-matter 18 | while (( $# )); do 19 | case "${args[$i]}" in 20 | -L) argsBefore+=("$1" "$2"); shift ;; 21 | -L?*) argsBefore+=("$1") ;; 22 | *) argsAfter+=("$1") ;; 23 | esac 24 | shift 25 | done 26 | 27 | # Trace: 28 | set -x 29 | exec "@ld@" "${argsBefore[@]}" "${argsAfter[@]}" 30 | -------------------------------------------------------------------------------- /build-support/cc-wrapper/add-clang-cc-cflags-before.sh: -------------------------------------------------------------------------------- 1 | needsTarget=true 2 | 3 | for p in "${params[@]}"; do 4 | case "$p" in 5 | -target | --target=*) needsTarget=false ;; 6 | esac 7 | done 8 | 9 | if $needsTarget && [[ $0 != *cpp ]]; then 10 | extraBefore+=(-target @defaultTarget@ @machineFlags@) 11 | fi 12 | -------------------------------------------------------------------------------- /build-support/cc-wrapper/add-gnat-extra-flags.sh: -------------------------------------------------------------------------------- 1 | # See add-flags.sh in cc-wrapper for comments. 2 | var_templates_list=( 3 | NIX_GNATMAKE_CARGS 4 | ) 5 | 6 | accumulateRoles 7 | 8 | for var in "${var_templates_list[@]}"; do 9 | mangleVarList "$var" ${role_suffixes[@]+"${role_suffixes[@]}"} 10 | done 11 | 12 | # `-B@out@/bin' forces cc to use wrapped as instead of the system one. 13 | NIX_GNATMAKE_CARGS_@suffixSalt@="$NIX_GNATMAKE_CARGS_@suffixSalt@ -B@out@/bin/" 14 | 15 | # Only add darwin min version flag if a default darwin min version is set, 16 | # which is a signal that we're targetting darwin. 17 | if [ "@darwinMinVersion@" ]; then 18 | mangleVarSingle @darwinMinVersionVariable@ ${role_suffixes[@]+"${role_suffixes[@]}"} 19 | 20 | NIX_GNATMAKE_CARGS_@suffixSalt@="-m@darwinPlatformForCC@-version-min=${@darwinMinVersionVariable@_@suffixSalt@:-@darwinMinVersion@} $NIX_GNATMAKE_CARGS_@suffixSalt@" 21 | fi 22 | 23 | export NIX_GNAT_WRAPPER_EXTRA_FLAGS_SET_@suffixSalt@=1 24 | -------------------------------------------------------------------------------- /build-support/cc-wrapper/fortran-hook.sh: -------------------------------------------------------------------------------- 1 | getTargetRole 2 | getTargetRoleWrapper 3 | 4 | export FC${role_post}=@named_fc@ 5 | 6 | # If unset, assume the default hardening flags. 7 | : ${NIX_HARDENING_ENABLE="@default_hardening_flags_str@"} 8 | export NIX_HARDENING_ENABLE 9 | 10 | unset -v role_post 11 | -------------------------------------------------------------------------------- /build-support/cc-wrapper/go-wrapper.sh: -------------------------------------------------------------------------------- 1 | #! @shell@ 2 | set -eu -o pipefail +o posix 3 | shopt -s nullglob 4 | 5 | if (( "${NIX_DEBUG:-0}" >= 7 )); then 6 | set -x 7 | fi 8 | 9 | export GCCGO="@out@/bin/gccgo" 10 | 11 | exec @prog@ "$@" 12 | -------------------------------------------------------------------------------- /build-support/fetchurl/boot.nix: -------------------------------------------------------------------------------- 1 | let mirrors = import ./mirrors.nix; in 2 | 3 | { system }: 4 | 5 | { url ? builtins.head urls 6 | , urls ? [] 7 | , sha256 ? "" 8 | , hash ? "" 9 | , name ? baseNameOf (toString url) 10 | }: 11 | 12 | # assert exactly one hash is set 13 | assert hash != "" || sha256 != ""; 14 | assert hash != "" -> sha256 == ""; 15 | 16 | import { 17 | inherit system hash sha256 name; 18 | 19 | url = 20 | # Handle mirror:// URIs. Since currently 21 | # supports only one URI, use the first listed mirror. 22 | let m = builtins.match "mirror://([a-z]+)/(.*)" url; in 23 | if m == null then url 24 | else builtins.head (mirrors.${builtins.elemAt m 0}) + (builtins.elemAt m 1); 25 | } 26 | -------------------------------------------------------------------------------- /build-support/fetchurl/tests.nix: -------------------------------------------------------------------------------- 1 | { testers, fetchurl, jq, moreutils, ... }: { 2 | # Tests that we can send custom headers with spaces in them 3 | header = 4 | let headerValue = "Test '\" <- These are some quotes"; 5 | in testers.invalidateFetcherByDrvHash fetchurl { 6 | url = "https://httpbin.org/headers"; 7 | sha256 = builtins.hashString "sha256" (headerValue + "\n"); 8 | curlOptsList = [ "-H" "Hello: ${headerValue}" ]; 9 | postFetch = '' 10 | ${jq}/bin/jq -r '.headers.Hello' $out | ${moreutils}/bin/sponge $out 11 | ''; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /build-support/fetchurl/write-mirror-list.sh: -------------------------------------------------------------------------------- 1 | source $stdenv/setup 2 | 3 | # !!! this is kinda hacky. 4 | set | grep -E '^[a-zA-Z]+=.*://' > $out 5 | -------------------------------------------------------------------------------- /build-support/nuke-references/darwin-sign-fixup.sh: -------------------------------------------------------------------------------- 1 | # Fixup hook for nukeReferences, not stdenv 2 | 3 | source @signingUtils@ 4 | 5 | fixupHooks+=(signIfRequired) 6 | -------------------------------------------------------------------------------- /build-support/nuke-references/nuke-refs.sh: -------------------------------------------------------------------------------- 1 | #! @shell@ 2 | 3 | fixupHooks=() 4 | 5 | if [ -e @out@/nix-support/setup-hooks.sh ]; then 6 | source @out@/nix-support/setup-hooks.sh 7 | fi 8 | 9 | excludes="" 10 | while getopts e: o; do 11 | case "$o" in 12 | e) storeId=$(echo "$OPTARG" | @perl@/bin/perl -ne "print \"\$1\" if m|^\Q@storeDir@\E/([a-z0-9]{32})-.*|") 13 | if [ -z "$storeId" ]; then 14 | echo "-e argument must be a Nix store path" 15 | exit 1 16 | fi 17 | excludes="$excludes(?!$storeId)" 18 | ;; 19 | esac 20 | done 21 | shift $(($OPTIND-1)) 22 | 23 | for i in "$@"; do 24 | if test ! -L "$i" -a -f "$i"; then 25 | cat "$i" | @perl@/bin/perl -pe "s|\Q@storeDir@\E/$excludes[a-z0-9]{32}-|@storeDir@/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" > "$i.tmp" 26 | if test -x "$i"; then chmod +x "$i.tmp"; fi 27 | mv "$i.tmp" "$i" 28 | 29 | for hook in "${fixupHooks[@]}"; do 30 | eval "$hook" "$i" 31 | done 32 | fi 33 | done 34 | -------------------------------------------------------------------------------- /build-support/setup-hooks/autoreconf.sh: -------------------------------------------------------------------------------- 1 | preConfigurePhases="${preConfigurePhases:-} autoreconfPhase" 2 | 3 | autoreconfPhase() { 4 | runHook preAutoreconf 5 | autoreconf ${autoreconfFlags:---install --force --verbose} 6 | runHook postAutoreconf 7 | } 8 | -------------------------------------------------------------------------------- /build-support/setup-hooks/breakpoint-hook.sh: -------------------------------------------------------------------------------- 1 | breakpointHook() { 2 | local red='\033[0;31m' 3 | local no_color='\033[0m' 4 | 5 | echo -e "${red}build failed in ${curPhase} with exit code ${exitCode}${no_color}" 6 | printf "To attach install cntr and run the following command as root:\n\n" 7 | sh -c "echo ' cntr attach -t command cntr-${out}'; while true; do sleep 99999999; done" 8 | } 9 | failureHooks+=(breakpointHook) 10 | -------------------------------------------------------------------------------- /build-support/setup-hooks/compress-man-pages.sh: -------------------------------------------------------------------------------- 1 | fixupOutputHooks+=('if [ -z "${dontGzipMan-}" ]; then compressManPages "$prefix"; fi') 2 | 3 | compressManPages() { 4 | local dir="$1" 5 | 6 | if [ -L "$dir"/share ] || [ -L "$dir"/share/man ] || [ ! -d "$dir/share/man" ] 7 | then return 8 | fi 9 | echo "gzipping man pages under $dir/share/man/" 10 | 11 | # Compress all uncompressed manpages. Don't follow symlinks, etc. 12 | find "$dir"/share/man/ -type f -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \ 13 | | while IFS= read -r -d $'\0' f 14 | do 15 | if gzip -c -n "$f" > "$f".gz; then 16 | rm "$f" 17 | else 18 | rm "$f".gz 19 | fi 20 | done 21 | 22 | # Point symlinks to compressed manpages. 23 | find "$dir"/share/man/ -type l -a '!' -regex '.*\.\(bz2\|gz\|xz\)$' -print0 \ 24 | | sort -z \ 25 | | while IFS= read -r -d $'\0' f 26 | do 27 | local target 28 | target="$(readlink -f "$f")" 29 | if [ -f "$target".gz ]; then 30 | ln -sf "$target".gz "$f".gz && rm "$f" 31 | fi 32 | done 33 | } 34 | -------------------------------------------------------------------------------- /build-support/setup-hooks/die.sh: -------------------------------------------------------------------------------- 1 | # Exit with backtrace and error message 2 | # 3 | # Usage: die "Error message" 4 | die() { 5 | # Let us be a little sloppy with errors, because otherwise the final 6 | # invocation of `caller` below will cause the script to exit. 7 | set +e 8 | 9 | # Print our error message 10 | printf "\nBuilder called die: %b\n" "$*" 11 | printf "Backtrace:\n" 12 | 13 | # Print a backtrace. 14 | local frame=0 15 | while caller $frame; do 16 | ((frame++)); 17 | done 18 | printf "\n" 19 | 20 | exit 1 21 | } 22 | -------------------------------------------------------------------------------- /build-support/setup-hooks/enable-coverage-instrumentation.sh: -------------------------------------------------------------------------------- 1 | postPhases+=" cleanupBuildDir" 2 | 3 | # Force GCC to build with coverage instrumentation. Also disable 4 | # optimisation, since it may confuse things. 5 | export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE:-} -O0 --coverage" 6 | 7 | # Get rid of everything that isn't a gcno file or a C source file. 8 | # Also strip the `.tmp_' prefix from gcno files. (The Linux kernel 9 | # creates these.) 10 | cleanupBuildDir() { 11 | if ! [ -e $out/.build ]; then return; fi 12 | 13 | find $out/.build/ -type f -a ! \ 14 | \( -name "*.c" -o -name "*.cc" -o -name "*.cpp" -o -name "*.h" -o -name "*.hh" -o -name "*.y" -o -name "*.l" -o -name "*.gcno" \) \ 15 | | xargs rm -f -- 16 | 17 | for i in $(find $out/.build/ -name ".tmp_*.gcno"); do 18 | mv "$i" "$(echo $i | sed s/.tmp_//)" 19 | done 20 | } 21 | -------------------------------------------------------------------------------- /build-support/setup-hooks/find-xml-catalogs.sh: -------------------------------------------------------------------------------- 1 | addXMLCatalogs () { 2 | local d i 3 | # ‘xml/dtd’ and ‘xml/xsl’ are deprecated. Catalogs should be 4 | # installed underneath ‘share/xml’. 5 | for d in $1/share/xml $1/xml/dtd $1/xml/xsl; do 6 | if [ -d $d ]; then 7 | for i in $(find $d -name catalog.xml); do 8 | XML_CATALOG_FILES+=" $i" 9 | done 10 | fi 11 | done 12 | } 13 | 14 | if [ -z "${libxmlHookDone-}" ]; then 15 | libxmlHookDone=1 16 | 17 | # Set up XML_CATALOG_FILES. An empty initial value prevents 18 | # xmllint and xsltproc from looking in /etc/xml/catalog. 19 | export XML_CATALOG_FILES='' 20 | if [ -z "$XML_CATALOG_FILES" ]; then XML_CATALOG_FILES=" "; fi 21 | addEnvHooks "$hostOffset" addXMLCatalogs 22 | fi 23 | -------------------------------------------------------------------------------- /build-support/setup-hooks/gog-unpack.sh: -------------------------------------------------------------------------------- 1 | unpackPhase="unpackGog" 2 | 3 | unpackGog() { 4 | runHook preUnpackGog 5 | 6 | innoextract --silent --extract --exclude-temp "${src}" 7 | 8 | find . -depth -print -execdir rename -f 'y/A-Z/a-z/' '{}' \; 9 | 10 | runHook postUnpackGog 11 | } 12 | -------------------------------------------------------------------------------- /build-support/setup-hooks/keep-build-tree.sh: -------------------------------------------------------------------------------- 1 | prePhases+=" moveBuildDir" 2 | 3 | moveBuildDir() { 4 | mkdir -p $out/.build 5 | cd $out/.build 6 | } 7 | -------------------------------------------------------------------------------- /build-support/setup-hooks/ld-is-cc-hook.sh: -------------------------------------------------------------------------------- 1 | ld-is-cc-hook() { 2 | LD=$CC 3 | } 4 | 5 | preConfigureHooks+=(ld-is-cc-hook) 6 | -------------------------------------------------------------------------------- /build-support/setup-hooks/make-binary-wrapper/default.nix: -------------------------------------------------------------------------------- 1 | { targetPackages 2 | , lib 3 | , makeSetupHook 4 | , dieHook 5 | , writeShellScript 6 | , tests 7 | , cc ? targetPackages.stdenv.cc 8 | , sanitizers ? [] 9 | }: 10 | 11 | makeSetupHook { 12 | name = "make-binary-wrapper-hook"; 13 | propagatedBuildInputs = [ dieHook ]; 14 | 15 | substitutions = { 16 | cc = "${cc}/bin/${cc.targetPrefix}cc ${lib.escapeShellArgs (map (s: "-fsanitize=${s}") sanitizers)}"; 17 | }; 18 | 19 | passthru = { 20 | # Extract the function call used to create a binary wrapper from its embedded docstring 21 | extractCmd = writeShellScript "extract-binary-wrapper-cmd" '' 22 | ${cc.bintools.targetPrefix}strings -dw "$1" | sed -n '/^makeCWrapper/,/^$/ p' 23 | ''; 24 | 25 | tests = tests.makeBinaryWrapper; 26 | }; 27 | } ./make-binary-wrapper.sh 28 | -------------------------------------------------------------------------------- /build-support/setup-hooks/make-coverage-analysis-report.sh: -------------------------------------------------------------------------------- 1 | postPhases+=" coverageReportPhase" 2 | 3 | coverageReportPhase() { 4 | lcov --directory . --capture --output-file app.info 5 | set -o noglob 6 | lcov --remove app.info ${lcovFilter:-"/nix/store/*"} > app2.info 7 | set +o noglob 8 | mv app2.info app.info 9 | 10 | mkdir -p $out/coverage 11 | genhtml app.info $lcovExtraTraceFiles -o $out/coverage > log 12 | 13 | # Grab the overall coverage percentage so that Hydra can plot it over time. 14 | mkdir -p $out/nix-support 15 | lineCoverage="$(sed 's/.*lines\.*: \([0-9\.]\+\)%.*/\1/; t ; d' log)" 16 | functionCoverage="$(sed 's/.*functions\.*: \([0-9\.]\+\)%.*/\1/; t ; d' log)" 17 | if [ -z "$lineCoverage" -o -z "$functionCoverage" ]; then 18 | echo "failed to get coverage statistics" 19 | exit 1 20 | fi 21 | echo "lineCoverage $lineCoverage %" >> $out/nix-support/hydra-metrics 22 | echo "functionCoverage $functionCoverage %" >> $out/nix-support/hydra-metrics 23 | 24 | echo "report coverage $out/coverage" >> $out/nix-support/hydra-build-products 25 | } 26 | -------------------------------------------------------------------------------- /build-support/setup-hooks/move-build-tree.sh: -------------------------------------------------------------------------------- 1 | prePhases+=" moveBuildDir" 2 | 3 | moveBuildDir() { 4 | mkdir -p $out/.build 5 | cd $out/.build 6 | } 7 | 8 | postPhases+=" removeBuildDir" 9 | 10 | removeBuildDir() { 11 | rm -rf $out/.build 12 | } 13 | -------------------------------------------------------------------------------- /build-support/setup-hooks/move-docs.sh: -------------------------------------------------------------------------------- 1 | # This setup hook moves $out/{man,doc,info} to $out/share. 2 | 3 | preFixupHooks+=(_moveToShare) 4 | 5 | _moveToShare() { 6 | if [ -n "$__structuredAttrs" ]; then 7 | if [ -z "${forceShare-}" ]; then 8 | forceShare=( man doc info ) 9 | fi 10 | else 11 | forceShare=( ${forceShare:-man doc info} ) 12 | fi 13 | 14 | if [[ -z "$out" ]]; then return; fi 15 | 16 | for d in "${forceShare[@]}"; do 17 | if [ -d "$out/$d" ]; then 18 | if [ -d "$out/share/$d" ]; then 19 | echo "both $d/ and share/$d/ exist!" 20 | else 21 | echo "moving $out/$d to $out/share/$d" 22 | mkdir -p $out/share 23 | mv $out/$d $out/share/ 24 | fi 25 | fi 26 | done 27 | } 28 | -------------------------------------------------------------------------------- /build-support/setup-hooks/move-lib64.sh: -------------------------------------------------------------------------------- 1 | # This setup hook, for each output, moves everything in $output/lib64 2 | # to $output/lib, and replaces $output/lib64 with a symlink to 3 | # $output/lib. The rationale is that lib64 directories are unnecessary 4 | # in Nix (since 32-bit and 64-bit builds of a package are in different 5 | # store paths anyway). 6 | # If the move would overwrite anything, it should fail on rmdir. 7 | 8 | fixupOutputHooks+=(_moveLib64) 9 | 10 | _moveLib64() { 11 | if [ "${dontMoveLib64-}" = 1 ]; then return; fi 12 | if [ ! -e "$prefix/lib64" -o -L "$prefix/lib64" ]; then return; fi 13 | echo "moving $prefix/lib64/* to $prefix/lib" 14 | mkdir -p $prefix/lib 15 | shopt -s dotglob 16 | for i in $prefix/lib64/*; do 17 | mv --no-clobber "$i" $prefix/lib 18 | done 19 | shopt -u dotglob 20 | rmdir $prefix/lib64 21 | ln -s lib $prefix/lib64 22 | } 23 | -------------------------------------------------------------------------------- /build-support/setup-hooks/move-sbin.sh: -------------------------------------------------------------------------------- 1 | # This setup hook, for each output, moves everything in $output/sbin 2 | # to $output/bin, and replaces $output/sbin with a symlink to 3 | # $output/bin. 4 | 5 | fixupOutputHooks+=(_moveSbin) 6 | 7 | _moveSbin() { 8 | if [ "${dontMoveSbin-}" = 1 ]; then return; fi 9 | if [ ! -e "$prefix/sbin" -o -L "$prefix/sbin" ]; then return; fi 10 | echo "moving $prefix/sbin/* to $prefix/bin" 11 | mkdir -p $prefix/bin 12 | shopt -s dotglob 13 | for i in $prefix/sbin/*; do 14 | mv "$i" $prefix/bin 15 | done 16 | shopt -u dotglob 17 | rmdir $prefix/sbin 18 | ln -s bin $prefix/sbin 19 | } 20 | -------------------------------------------------------------------------------- /build-support/setup-hooks/move-systemd-user-units.sh: -------------------------------------------------------------------------------- 1 | # shellcheck shell=bash 2 | 3 | # This setup hook, for each output, moves everything in 4 | # $output/lib/systemd/user to $output/share/systemd/user, and replaces 5 | # $output/lib/systemd/user with a symlink to 6 | # $output/share/systemd/user. 7 | 8 | fixupOutputHooks+=(_moveSystemdUserUnits) 9 | 10 | _moveSystemdUserUnits() { 11 | if [ "${dontMoveSystemdUserUnits:-0}" = 1 ]; then return; fi 12 | if [ ! -e "${prefix:?}/lib/systemd/user" ]; then return; fi 13 | local source="$prefix/lib/systemd/user" 14 | local target="$prefix/share/systemd/user" 15 | echo "moving $source/* to $target" 16 | mkdir -p "$target" 17 | ( 18 | shopt -s dotglob 19 | for i in "$source"/*; do 20 | mv "$i" "$target" 21 | done 22 | ) 23 | rmdir "$source" 24 | ln -s "$target" "$source" 25 | } 26 | -------------------------------------------------------------------------------- /build-support/setup-hooks/mpi-check-hook/default.nix: -------------------------------------------------------------------------------- 1 | { callPackage, makeSetupHook }: 2 | 3 | makeSetupHook { 4 | name = "mpi-checkPhase-hook"; 5 | } ./mpi-check-hook.sh 6 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-ppd-files/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , makeSetupHook 3 | , which 4 | , callPackage 5 | }: 6 | 7 | makeSetupHook { 8 | name = "patch-ppd-files"; 9 | substitutions = { 10 | which = lib.getBin which; 11 | awkscript = ./patch-ppd-lines.awk; 12 | }; 13 | passthru.tests.test = callPackage ./test.nix {}; 14 | meta = { 15 | description = "setup hook to patch executable paths in ppd files"; 16 | maintainers = [ ]; 17 | }; 18 | } ./patch-ppd-hook.sh 19 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-ppd-files/test.nix: -------------------------------------------------------------------------------- 1 | { substituteAll 2 | , diffutils 3 | , stdenv 4 | , patchPpdFilesHook 5 | }: 6 | 7 | let 8 | input = substituteAll { 9 | src = ./test.ppd; 10 | keep = "cmp"; 11 | patch = "cmp"; 12 | pathkeep = "/bin/cmp"; 13 | pathpatch = "/bin/cmp"; 14 | }; 15 | 16 | output = substituteAll { 17 | src = ./test.ppd; 18 | keep = "cmp"; 19 | patch = "${diffutils}/bin/cmp"; 20 | pathkeep = "/bin/cmp"; 21 | pathpatch = "${diffutils}/bin/cmp"; 22 | }; 23 | in 24 | 25 | stdenv.mkDerivation { 26 | name = "${patchPpdFilesHook.name}-test"; 27 | buildInputs = [ diffutils ]; 28 | nativeBuildInputs = [ diffutils patchPpdFilesHook ]; 29 | dontUnpack = true; 30 | dontInstall = true; 31 | ppdFileCommands = [ "cmp" ]; 32 | preFixup = '' 33 | install -D "${input}" "${placeholder "out"}/share/cups/model/test.ppd" 34 | install -D "${input}" "${placeholder "out"}/share/ppds/test.ppd" 35 | ''; 36 | postFixup = '' 37 | diff --color --report-identical-files "${output}" "${placeholder "out"}/share/cups/model/test.ppd" 38 | diff --color --report-identical-files "${output}" "${placeholder "out"}/share/ppds/test.ppd" 39 | ''; 40 | } 41 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-ppd-files/test.ppd: -------------------------------------------------------------------------------- 1 | *% This comment: might look like a command @keep@ 2 | *% but it should be left untouched 3 | *SomeKey: do not replace this @keep@ 4 | *APAutoSetupTool: do replace this @patch@ 5 | *FoomaticRIPCommandLine: "patch also @patch@ 6 | in a multi-line command @patch@ 7 | and another line @patch@ 8 | *SomeKey: "stop patching on new non-command key @keep@ 9 | and remember the key in the next line @keep@" 10 | *cupsFilter option: recognize keys with options @patch@ 11 | *cupsFilter : handle strange spacing;@patch@ 12 | *cupsFilter : handle tabulator @patch@ 13 | *cupsFilter: patch common paths @pathpatch@ 14 | *cupsFilter: patch quoted commands "@patch@" 15 | *cupsFilter: patch commands in subshell (@patch@) 16 | *cupsFilter: patch commands in subshell `@pathpatch@` 17 | *cupsFilter: keep uncommon paths /fancy/@pathkeep@ 18 | *cupsFilter: keep entangled commands-@keep@ 19 | *cupsFilter: keep entangled commands\@keep@ 20 | *cupsFilter: keep entangled commands @keep@() 21 | *cupsFilter: keep entangled commands @pathkeep@-cmd 22 | *%cupsFilter: This comment should also be left as is @pathkeep@ 23 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/sample_source.bash: -------------------------------------------------------------------------------- 1 | PATH="$PWD/charlie:${PATH/:$PWD\/bravo}" 2 | export PATH 3 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/sample_source.csh.in: -------------------------------------------------------------------------------- 1 | setenv PATH $PWD/charlie:`echo "$PATH" | @sed@ "s#:$PWD/bravo##"` 2 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/sample_source.fish: -------------------------------------------------------------------------------- 1 | begin 2 | for p in $PATH 3 | if test $p != "$PWD/bravo" 4 | set TEMPORARY_PATH $TEMPORARY_PATH $p 5 | end 6 | end 7 | set -g PATH $TEMPORARY_PATH 8 | end 9 | set PATH "$PWD/charlie" $PATH 10 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/sample_source.sh.in: -------------------------------------------------------------------------------- 1 | PATH="$PWD/charlie:$(echo "$PATH" | @sed@ "s#:$PWD/bravo##")" 2 | export PATH 3 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/test-sourcing-bash: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -eu -o pipefail 4 | 5 | UNPATCHED_SOURCE_FILE="$1" 6 | PATCHED_SOURCE_FILE="$2" 7 | ORIG_PATH="$PWD/alfa:$PWD/bravo" 8 | RESULT_PATH_FROM_UNPATCHED="$( 9 | PATH="$ORIG_PATH"; export PATH 10 | . "$UNPATCHED_SOURCE_FILE" 11 | echo "$PATH" 12 | )" 13 | RESULT_PATH_FROM_PATCHED="$( 14 | PATH="$ORIG_PATH"; export PATH 15 | . "$PATCHED_SOURCE_FILE" 16 | echo "$PATH" 17 | )" 18 | if [[ "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" ]]; then 19 | echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" >&2 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/test-sourcing-csh: -------------------------------------------------------------------------------- 1 | #/usr/bin/env tcsh 2 | 3 | set UNPATCHED_SOURCE_FILE = "$1" 4 | set PATCHED_SOURCE_FILE = "$2" 5 | set ORIG_PATH = "${PWD}/alfa:${PWD}/bravo" 6 | 7 | set RESULT_PATH_FROM_UNPATCHED = `setenv PATH "$ORIG_PATH"; source $UNPATCHED_SOURCE_FILE; echo $PATH` 8 | set RESULT_PATH_FROM_PATCHED = `setenv PATH "$ORIG_PATH"; source $PATCHED_SOURCE_FILE; echo $PATH` 9 | 10 | if ($RESULT_PATH_FROM_UNPATCHED != $RESULT_PATH_FROM_PATCHED) then 11 | echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" > /dev/stderr 12 | exit 1 13 | endif 14 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/test-sourcing-fish: -------------------------------------------------------------------------------- 1 | #/usr/bin/env fish 2 | 3 | set UNPATCHED_SOURCE_FILE $argv[1] 4 | set PATCHED_SOURCE_FILE $argv[2] 5 | set ORIG_PATH "$PWD/alfa:$PWD/bravo" 6 | 7 | set RESULT_PATH_FROM_UNPATCHED (fish -c "set -g PATH \"$ORIG_PATH\"; source $UNPATCHED_SOURCE_FILE; echo \"\$PATH\"") 8 | set RESULT_PATH_FROM_PATCHED (fish -c "set -g PATH \"$ORIG_PATH\"; source $PATCHED_SOURCE_FILE; echo \"\$PATH\"") 9 | 10 | if test "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" 11 | echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" >&2 12 | exit 1 13 | end 14 | -------------------------------------------------------------------------------- /build-support/setup-hooks/patch-rc-path-hooks/test/test-sourcing-posix: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -eu 4 | 5 | UNPATCHED_SOURCE_FILE="$1" 6 | PATCHED_SOURCE_FILE="$2" 7 | ORIG_PATH="$PWD/alfa:$PWD/bravo" 8 | RESULT_PATH_FROM_UNPATCHED="$( 9 | PATH="$ORIG_PATH"; export PATH 10 | . "$UNPATCHED_SOURCE_FILE" 11 | echo "$PATH" 12 | )" 13 | RESULT_PATH_FROM_PATCHED="$( 14 | PATH="$ORIG_PATH"; export PATH 15 | . "$PATCHED_SOURCE_FILE" 16 | echo "$PATH" 17 | )" 18 | if [ "$RESULT_PATH_FROM_UNPATCHED" != "$RESULT_PATH_FROM_PATCHED" ]; then 19 | echo "Result path mismatched: $UNPATCHED_SOURCE_FILE ($RESULT_PATH_FROM_UNPATCHED) and $PATCHED_SOURCE_FILE ($RESULT_PATH_FROM_PATCHED)" > /dev/stderr 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /build-support/setup-hooks/postgresql-test-hook/default.nix: -------------------------------------------------------------------------------- 1 | { callPackage, makeSetupHook }: 2 | 3 | makeSetupHook { 4 | name = "postgresql-test-hook"; 5 | passthru.tests = { 6 | simple = callPackage ./test.nix { }; 7 | }; 8 | } ./postgresql-test-hook.sh 9 | -------------------------------------------------------------------------------- /build-support/setup-hooks/postgresql-test-hook/test.nix: -------------------------------------------------------------------------------- 1 | { postgresql, postgresqlTestHook, stdenv }: 2 | 3 | stdenv.mkDerivation { 4 | name = "postgresql-test-hook-test"; 5 | buildInputs = [ postgresqlTestHook ]; 6 | nativeCheckInputs = [ postgresql ]; 7 | dontUnpack = true; 8 | doCheck = true; 9 | passAsFile = ["sql"]; 10 | sql = '' 11 | CREATE TABLE hello ( 12 | message text 13 | ); 14 | INSERT INTO hello VALUES ('it '||'worked'); 15 | SELECT * FROM hello; 16 | ''; 17 | postgresqlTestSetupPost = '' 18 | TEST_POST_HOOK_RAN=1 19 | ''; 20 | checkPhase = '' 21 | runHook preCheck 22 | psql <$sqlPath | grep 'it worked' 23 | TEST_RAN=1 24 | runHook postCheck 25 | ''; 26 | installPhase = '' 27 | [[ $TEST_RAN == 1 && $TEST_POST_HOOK_RAN == 1 ]] 28 | touch $out 29 | ''; 30 | } 31 | -------------------------------------------------------------------------------- /build-support/setup-hooks/prune-libtool-files.sh: -------------------------------------------------------------------------------- 1 | # Clear dependency_libs in libtool files for shared libraries. 2 | 3 | # Shared libraries already encode their dependencies with locations. .la 4 | # files do not always encode those locations, and sometimes encode the 5 | # locations in the wrong Nix output. .la files are not needed for shared 6 | # libraries, but without dependency_libs they do not hurt either. 7 | 8 | fixupOutputHooks+=(_pruneLibtoolFiles) 9 | 10 | _pruneLibtoolFiles() { 11 | if [ "${dontPruneLibtoolFiles-}" ] || [ ! -e "$prefix" ]; then 12 | return 13 | fi 14 | 15 | # Libtool uses "dlname" and "library_names" fields for shared libraries and 16 | # the "old_library" field for static libraries. We are processing only 17 | # those .la files that do not describe static libraries. 18 | find "$prefix" -type f -name '*.la' \ 19 | -exec grep -q '^# Generated by .*libtool' {} \; \ 20 | -exec grep -q "^old_library=''" {} \; \ 21 | -exec sed -i {} -e "/^dependency_libs='[^']/ c dependency_libs='' #pruned" \; 22 | } 23 | -------------------------------------------------------------------------------- /build-support/setup-hooks/reproducible-builds.sh: -------------------------------------------------------------------------------- 1 | # Use the last part of the out path as hash input for the build. 2 | # This should ensure that it is deterministic across rebuilds of the same 3 | # derivation and not easily collide with other builds. 4 | # We also truncate the hash so that it cannot cause reference cycles. 5 | NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE:-} -frandom-seed=$( 6 | randSeed=${NIX_OUTPATH_USED_AS_RANDOM_SEED:-$out} 7 | outbase="${randSeed##*/}" 8 | randomseed="${outbase:0:10}" 9 | echo $randomseed 10 | )" 11 | export NIX_CFLAGS_COMPILE 12 | -------------------------------------------------------------------------------- /build-support/setup-hooks/set-java-classpath.sh: -------------------------------------------------------------------------------- 1 | # This setup hook adds every JAR in the share/java subdirectories of 2 | # the build inputs to $CLASSPATH. 3 | 4 | export CLASSPATH 5 | 6 | addPkgToClassPath () { 7 | local jar 8 | for jar in $1/share/java/*.jar; do 9 | export CLASSPATH=''${CLASSPATH-}''${CLASSPATH:+:}''${jar} 10 | done 11 | } 12 | 13 | addEnvHooks "$targetOffset" addPkgToClassPath 14 | -------------------------------------------------------------------------------- /build-support/setup-hooks/setup-debug-info-dirs.sh: -------------------------------------------------------------------------------- 1 | setupDebugInfoDirs () { 2 | addToSearchPath NIX_DEBUG_INFO_DIRS $1/lib/debug 3 | } 4 | 5 | addEnvHooks "$targetOffset" setupDebugInfoDirs 6 | -------------------------------------------------------------------------------- /build-support/setup-hooks/strip-java-archives.sh: -------------------------------------------------------------------------------- 1 | # This setup hook makes the fixup phase to repack all java archives in a 2 | # deterministic fashion. The most important change being done is the resetting 3 | # of the modification times of the archive entries 4 | 5 | fixupOutputHooks+=('stripJavaArchivesIn $prefix') 6 | 7 | stripJavaArchivesIn() { 8 | local dir="$1" 9 | echo "stripping java archives in $dir" 10 | find $dir -type f -regextype posix-egrep -regex ".*\.(jar|war|hpi|apk)$" -print0 | 11 | while IFS= read -rd '' f; do 12 | echo "stripping java archive $f" 13 | strip-nondeterminism --type jar "$f" 14 | done 15 | } 16 | 17 | -------------------------------------------------------------------------------- /build-support/setup-hooks/update-autotools-gnu-config-scripts.sh: -------------------------------------------------------------------------------- 1 | preConfigurePhases+=" updateAutotoolsGnuConfigScriptsPhase" 2 | 3 | updateAutotoolsGnuConfigScriptsPhase() { 4 | if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then return; fi 5 | 6 | for script in config.sub config.guess; do 7 | for f in $(find . -type f -name "$script"); do 8 | echo "Updating Autotools / GNU config script to a newer upstream version: $f" 9 | cp -f "@gnu_config@/$script" "$f" 10 | done 11 | done 12 | } 13 | -------------------------------------------------------------------------------- /build-support/setup-hooks/use-old-cxx-abi.sh: -------------------------------------------------------------------------------- 1 | export NIX_CFLAGS_COMPILE+=" -D_GLIBCXX_USE_CXX11_ABI=0" 2 | -------------------------------------------------------------------------------- /build-support/setup-hooks/validate-pkg-config.sh: -------------------------------------------------------------------------------- 1 | # This setup hook validates each pkgconfig file in each output. 2 | 3 | fixupOutputHooks+=(_validatePkgConfig) 4 | 5 | _validatePkgConfig() { 6 | local bail=0 7 | for pc in $(find "$prefix" -name '*.pc'); do 8 | # Do not fail immediately. It's nice to see all errors when 9 | # there are multiple pkgconfig files. 10 | if ! $PKG_CONFIG --validate "$pc"; then 11 | bail=1 12 | fi 13 | done 14 | 15 | if [ $bail -eq 1 ]; then 16 | exit 1 17 | fi 18 | } 19 | -------------------------------------------------------------------------------- /build-support/setup-hooks/wrap-gapps-hook/tests/lib.nix: -------------------------------------------------------------------------------- 1 | { lib, runCommand }: 2 | 3 | rec { 4 | runTest = name: body: runCommand name { strictDeps = true; } '' 5 | set -o errexit 6 | ${body} 7 | touch $out 8 | ''; 9 | 10 | skip = cond: text: 11 | if cond then '' 12 | echo "Skipping test $name" > /dev/stderr 13 | '' else text; 14 | 15 | fail = text: '' 16 | echo "FAIL: $name: ${text}" > /dev/stderr 17 | exit 1 18 | ''; 19 | 20 | expectSomeLineContainingYInFileXToMentionZ = file: filter: expected: '' 21 | file=${lib.escapeShellArg file} filter=${lib.escapeShellArg filter} expected=${lib.escapeShellArg expected} 22 | 23 | if ! grep --text --quiet "$filter" "$file"; then 24 | ${fail "The file “$file” should include a line containing “$filter”."} 25 | fi 26 | 27 | if ! grep --text "$filter" "$file" | grep --text --quiet "$expected"; then 28 | ${fail "The file “$file” should include a line containing “$filter” that also contains “$expected”."} 29 | fi 30 | ''; 31 | } 32 | -------------------------------------------------------------------------------- /build-support/setup-hooks/wrap-gapps-hook/tests/sample-project/Makefile: -------------------------------------------------------------------------------- 1 | PREFIX = $(out) 2 | BINDIR = $(PREFIX)/bin 3 | LIBEXECDIR = $(PREFIX)/libexec 4 | LIBDIR = $(PREFIX)/lib 5 | TYPELIBDIR = $(LIBDIR)/girepository-1.0 6 | 7 | all: 8 | echo "Compiling…" 9 | install: 10 | echo "Installing…" 11 | 12 | bin: 13 | mkdir -p $(BINDIR) 14 | # Adds `bin-${foo}` targets, that install `${foo}` executable to `$(BINDIR)`. 15 | bin-%: bin 16 | touch $(BINDIR)/$(@:bin-%=%) 17 | chmod +x $(BINDIR)/$(@:bin-%=%) 18 | 19 | libexec: 20 | mkdir -p $(LIBEXECDIR) 21 | # Adds `libexec-${foo}` targets, that install `${foo}` executable to `$(LIBEXECDIR)`. 22 | libexec-%: libexec 23 | touch $(LIBEXECDIR)/$(@:libexec-%=%) 24 | chmod +x $(LIBEXECDIR)/$(@:libexec-%=%) 25 | 26 | typelib: 27 | mkdir -p $(TYPELIBDIR) 28 | # Adds `typelib-${foo}` targets, that install `${foo}-1.0.typelib` file to `$(TYPELIBDIR)`. 29 | typelib-%: typelib 30 | touch $(TYPELIBDIR)/$(@:typelib-%=%)-1.0.typelib 31 | -------------------------------------------------------------------------------- /build-support/testers/shellcheck/example.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | echo $@ 4 | -------------------------------------------------------------------------------- /build-support/testers/shellcheck/tester.nix: -------------------------------------------------------------------------------- 1 | # Dependencies (callPackage) 2 | { lib, stdenv, shellcheck }: 3 | 4 | # testers.shellcheck function 5 | # Docs: doc/build-helpers/testers.chapter.md 6 | # Tests: ./tests.nix 7 | { src }: 8 | let 9 | inherit (lib) fileset pathType isPath; 10 | in 11 | stdenv.mkDerivation { 12 | name = "run-shellcheck"; 13 | src = 14 | if isPath src && pathType src == "regular" # note that for strings this would have been IFD, which we prefer to avoid 15 | then fileset.toSource { root = dirOf src; fileset = src; } 16 | else src; 17 | nativeBuildInputs = [ shellcheck ]; 18 | doCheck = true; 19 | dontConfigure = true; 20 | dontBuild = true; 21 | checkPhase = '' 22 | find . -type f -print0 \ 23 | | xargs -0 shellcheck 24 | ''; 25 | installPhase = '' 26 | touch $out 27 | ''; 28 | } 29 | -------------------------------------------------------------------------------- /build-support/testers/shellcheck/tests.nix: -------------------------------------------------------------------------------- 1 | # Run: 2 | # nix-build -A tests.testers.shellcheck 3 | 4 | { lib, testers, runCommand }: 5 | let 6 | inherit (lib) fileset; 7 | in 8 | lib.recurseIntoAttrs { 9 | 10 | example-dir = runCommand "test-testers-shellcheck-example-dir" { 11 | failure = testers.testBuildFailure 12 | (testers.shellcheck { 13 | src = fileset.toSource { 14 | root = ./.; 15 | fileset = fileset.unions [ 16 | ./example.sh 17 | ]; 18 | }; 19 | }); 20 | } '' 21 | log="$failure/testBuildFailure.log" 22 | echo "Checking $log" 23 | grep SC2068 "$log" 24 | touch $out 25 | ''; 26 | 27 | example-file = runCommand "test-testers-shellcheck-example-file" { 28 | failure = testers.testBuildFailure 29 | (testers.shellcheck { 30 | src = ./example.sh; 31 | }); 32 | } '' 33 | log="$failure/testBuildFailure.log" 34 | echo "Checking $log" 35 | grep SC2068 "$log" 36 | touch $out 37 | ''; 38 | } 39 | -------------------------------------------------------------------------------- /build-support/testers/test-equal-derivation.nix: -------------------------------------------------------------------------------- 1 | { lib, runCommand, emptyFile, nix-diff }: 2 | 3 | assertion: a: b: 4 | let 5 | drvA = builtins.unsafeDiscardOutputDependency a.drvPath or (throw "testEqualDerivation second argument must be a package"); 6 | drvB = builtins.unsafeDiscardOutputDependency b.drvPath or (throw "testEqualDerivation third argument must be a package"); 7 | name = 8 | if a?name 9 | then "testEqualDerivation-${a.name}" 10 | else "testEqualDerivation"; 11 | in 12 | if drvA == drvB then 13 | emptyFile 14 | else 15 | runCommand name 16 | { 17 | inherit assertion drvA drvB; 18 | nativeBuildInputs = [ nix-diff ]; 19 | } '' 20 | echo "$assertion" 21 | echo "However, the derivations differ:" 22 | echo 23 | echo nix-diff $drvA $drvB 24 | nix-diff $drvA $drvB 25 | exit 1 26 | '' 27 | -------------------------------------------------------------------------------- /build-support/testers/test/README.md: -------------------------------------------------------------------------------- 1 | # Tests _for the testers_ 2 | 3 | cd nixpkgs 4 | nix-build -A tests.testers 5 | 6 | Tests generally derive their own correctness from simplicity, which in the 7 | case of testers (themselves functions) does not always work out. 8 | Hence the need for tests that test the testers. 9 | -------------------------------------------------------------------------------- /build-support/testers/testMetaPkgConfig/tester.nix: -------------------------------------------------------------------------------- 1 | { lib, runCommand, testers }: 2 | 3 | package: 4 | 5 | runCommand "check-meta-pkg-config-modules-for-${package.name}" { 6 | meta = { 7 | description = "Test whether ${package.name} exposes all pkg-config modules ${toString package.meta.pkgConfigModules}"; 8 | }; 9 | dependsOn = testers.hasPkgConfigModules { inherit package; }; 10 | } '' 11 | echo "found all of ${toString package.meta.pkgConfigModules}" > "$out" 12 | '' 13 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/concat-test.nix: -------------------------------------------------------------------------------- 1 | { runCommand, concatText, writeText, hello, emptyFile }: 2 | let 3 | stri = writeText "pathToTest"; 4 | txt1 = stri "abc"; 5 | txt2 = stri (builtins.toString hello); 6 | res = concatText "textToTest" [ txt1 txt2 ]; 7 | in 8 | runCommand "test-concatPaths" { } '' 9 | diff -U3 <(cat ${txt1} ${txt2}) ${res} 10 | diff -U3 ${concatText "void" []} ${emptyFile} 11 | touch $out 12 | '' 13 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/default.nix: -------------------------------------------------------------------------------- 1 | /* 2 | Run all tests with: 3 | 4 | cd nixpkgs 5 | nix-build -A tests.trivial-builders 6 | 7 | or run a specific test with: 8 | 9 | cd nixpkgs 10 | nix-build -A tests.trivial-builders.foo 11 | 12 | */ 13 | 14 | { callPackage, lib, stdenv }: 15 | let 16 | inherit (lib) recurseIntoAttrs; 17 | references = callPackage ./references {}; 18 | in 19 | recurseIntoAttrs { 20 | concat = callPackage ./concat-test.nix {}; 21 | linkFarm = callPackage ./link-farm.nix {}; 22 | overriding = callPackage ../test-overriding.nix {}; 23 | inherit references; 24 | writeCBin = callPackage ./writeCBin.nix {}; 25 | writeClosure-union = callPackage ./writeClosure-union.nix { 26 | inherit (references) samples; 27 | }; 28 | writeShellApplication = callPackage ./writeShellApplication.nix {}; 29 | writeScriptBin = callPackage ./writeScriptBin.nix {}; 30 | writeShellScript = callPackage ./write-shell-script.nix {}; 31 | writeShellScriptBin = callPackage ./writeShellScriptBin.nix {}; 32 | writeStringReferencesToFile = callPackage ./writeStringReferencesToFile.nix { 33 | inherit (references) samples; 34 | }; 35 | writeTextFile = callPackage ./write-text-file.nix {}; 36 | } 37 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/references/apath.txt: -------------------------------------------------------------------------------- 1 | Just some text 2 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/references/samples.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , runCommand 3 | , writeText 4 | , emptyFile 5 | , emptyDirectory 6 | , figlet 7 | , hello 8 | , zlib 9 | }: 10 | { 11 | inherit 12 | figlet 13 | hello 14 | zlib 15 | ; 16 | zlib-dev = zlib.dev; 17 | norefs = writeText "hi" "hello"; 18 | norefsDup = writeText "hi" "hello"; 19 | helloRef = writeText "hi" "hello ${hello}"; 20 | helloRefDup = writeText "hi" "hello ${hello}"; 21 | path = ./apath.txt; 22 | pathLike.outPath = ./apath.txt; 23 | helloFigletRef = writeText "hi" "hello ${hello} ${figlet}"; 24 | selfRef = runCommand "self-ref-1" { } "echo $out >$out"; 25 | selfRef2 = runCommand "self-ref-2" { } ''echo "${figlet}, $out" >$out''; 26 | inherit 27 | emptyFile 28 | emptyDirectory 29 | ; 30 | } 31 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/write-shell-script.nix: -------------------------------------------------------------------------------- 1 | { lib, writeShellScript }: let 2 | output = "hello"; 3 | in (writeShellScript "test-script" '' 4 | echo ${lib.escapeShellArg output} 5 | '').overrideAttrs (old: { 6 | checkPhase = old.checkPhase or "" + '' 7 | expected=${lib.escapeShellArg output} 8 | got=$("$target") 9 | if [[ "$got" != "$expected" ]]; then 10 | echo "wrong output: expected $expected, got $got" 11 | exit 1 12 | fi 13 | ''; 14 | }) 15 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/writeCBin.nix: -------------------------------------------------------------------------------- 1 | /* 2 | Run with: 3 | 4 | cd nixpkgs 5 | nix-build -A tests.trivial-builders.writeCBin 6 | */ 7 | 8 | { lib, writeCBin, runCommand }: 9 | let 10 | output = "hello"; 11 | pkg = writeCBin "test-script" '' 12 | #include 13 | int main () { 14 | printf("hello\n"); 15 | return 0; 16 | } 17 | ''; 18 | in 19 | assert pkg.meta.mainProgram == "test-script"; 20 | runCommand "test-writeCBin" { } '' 21 | 22 | echo Testing with getExe... 23 | 24 | target=${lib.getExe pkg} 25 | expected=${lib.escapeShellArg output} 26 | got=$("$target") 27 | if [[ "$got" != "$expected" ]]; then 28 | echo "wrong output: expected $expected, got $got" 29 | exit 1 30 | fi 31 | 32 | echo Testing with makeBinPath... 33 | 34 | PATH="${lib.makeBinPath [ pkg ]}:$PATH" 35 | got=$(test-script) 36 | if [[ "$got" != "$expected" ]]; then 37 | echo "wrong output: expected $expected, got $got" 38 | exit 1 39 | fi 40 | 41 | touch $out 42 | '' 43 | 44 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/writeClosure-union.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , runCommandLocal 3 | # Test targets 4 | , writeClosure 5 | , samples 6 | }: 7 | 8 | runCommandLocal "test-trivial-builders-writeClosure-union" { 9 | __structuredAttrs = true; 10 | closures = lib.mapAttrs (n: v: writeClosure [ v ]) samples; 11 | collectiveClosure = writeClosure (lib.attrValues samples); 12 | inherit samples; 13 | meta.maintainers = with lib.maintainers; [ 14 | ]; 15 | } '' 16 | set -eu -o pipefail 17 | echo >&2 Testing mixed closures... 18 | echo >&2 Checking all samples "(''${samples[*]})" "$collectiveClosure" 19 | diff -U3 \ 20 | <(sort <"$collectiveClosure") \ 21 | <(cat "''${closures[@]}" | sort | uniq) 22 | touch "$out" 23 | '' 24 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/writeScriptBin.nix: -------------------------------------------------------------------------------- 1 | /* 2 | Run with: 3 | 4 | cd nixpkgs 5 | nix-build -A tests.trivial-builders.writeShellScriptBin 6 | */ 7 | 8 | { lib, writeScriptBin, runCommand }: 9 | let 10 | output = "hello"; 11 | pkg = writeScriptBin "test-script" '' 12 | echo ${lib.escapeShellArg output} 13 | ''; 14 | in 15 | assert pkg.meta.mainProgram == "test-script"; 16 | runCommand "test-writeScriptBin" { } '' 17 | 18 | echo Testing with getExe... 19 | 20 | target=${lib.getExe pkg} 21 | expected=${lib.escapeShellArg output} 22 | got=$("$target") 23 | if [[ "$got" != "$expected" ]]; then 24 | echo "wrong output: expected $expected, got $got" 25 | exit 1 26 | fi 27 | 28 | echo Testing with makeBinPath... 29 | 30 | PATH="${lib.makeBinPath [ pkg ]}:$PATH" 31 | got=$(test-script) 32 | if [[ "$got" != "$expected" ]]; then 33 | echo "wrong output: expected $expected, got $got" 34 | exit 1 35 | fi 36 | 37 | touch $out 38 | '' 39 | 40 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/writeShellScriptBin.nix: -------------------------------------------------------------------------------- 1 | /* 2 | Run with: 3 | 4 | cd nixpkgs 5 | nix-build -A tests.trivial-builders.writeShellScriptBin 6 | */ 7 | 8 | { lib, writeShellScriptBin, runCommand }: 9 | let 10 | output = "hello"; 11 | pkg = writeShellScriptBin "test-script" '' 12 | echo ${lib.escapeShellArg output} 13 | ''; 14 | in 15 | assert pkg.meta.mainProgram == "test-script"; 16 | runCommand "test-writeShellScriptBin" { } '' 17 | 18 | echo Testing with getExe... 19 | 20 | target=${lib.getExe pkg} 21 | expected=${lib.escapeShellArg output} 22 | got=$("$target") 23 | if [[ "$got" != "$expected" ]]; then 24 | echo "wrong output: expected $expected, got $got" 25 | exit 1 26 | fi 27 | 28 | echo Testing with makeBinPath... 29 | 30 | PATH="${lib.makeBinPath [ pkg ]}:$PATH" 31 | got=$(test-script) 32 | if [[ "$got" != "$expected" ]]; then 33 | echo "wrong output: expected $expected, got $got" 34 | exit 1 35 | fi 36 | 37 | touch $out 38 | '' 39 | 40 | -------------------------------------------------------------------------------- /build-support/trivial-builders/test/writeStringReferencesToFile.nix: -------------------------------------------------------------------------------- 1 | { callPackage, lib, pkgs, runCommand, samples, writeText, writeStringReferencesToFile }: 2 | let 3 | samplePaths = lib.unique (lib.attrValues samples); 4 | stri = x: "${x}"; 5 | sampleText = writeText "sample-text" (lib.concatStringsSep "\n" (lib.unique (map stri samplePaths))); 6 | stringReferencesText = 7 | writeStringReferencesToFile 8 | ((lib.concatMapStringsSep "fillertext" 9 | stri 10 | (lib.attrValues samples)) + '' 11 | STORE=${builtins.storeDir};\nsystemctl start bar-foo.service 12 | ''); 13 | in 14 | runCommand "test-writeStringReferencesToFile" { } '' 15 | diff -U3 <(sort ${stringReferencesText}) <(sort ${sampleText}) 16 | touch $out 17 | '' 18 | -------------------------------------------------------------------------------- /custom/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , localSystem, crossSystem, config, overlays, crossOverlays ? [] 3 | }: 4 | 5 | assert crossSystem == localSystem; 6 | 7 | let 8 | bootStages = import ../stdenv.nix { 9 | inherit lib localSystem crossSystem overlays; 10 | # Remove config.replaceStdenv to ensure termination. 11 | config = builtins.removeAttrs config [ "replaceStdenv" ]; 12 | }; 13 | 14 | in bootStages ++ [ 15 | 16 | # Additional stage, built using custom stdenv 17 | (vanillaPackages: { 18 | inherit config overlays; 19 | stdenv = 20 | assert vanillaPackages.hostPlatform == localSystem; 21 | assert vanillaPackages.targetPlatform == localSystem; 22 | config.replaceStdenv { pkgs = vanillaPackages; }; 23 | }) 24 | 25 | ] 26 | -------------------------------------------------------------------------------- /cygwin/all-buildinputs-as-runtimedep.sh: -------------------------------------------------------------------------------- 1 | # On cygwin, automatic runtime dependency detection does not work 2 | # because the binaries do not contain absolute references to store 3 | # locations (yet) 4 | postFixupHooks+=(_cygwinAllBuildInputsAsRuntimeDep) 5 | 6 | _cygwinAllBuildInputsAsRuntimeDep() { 7 | if [ -n "$buildInputs" ]; then 8 | mkdir -p "$out/nix-support" 9 | echo "$buildInputs" >> "$out/nix-support/cygwin-buildinputs-as-runtime-deps" 10 | fi 11 | 12 | if [ -n "$nativeBuildInputs" ]; then 13 | mkdir -p "$out/nix-support" 14 | echo "$nativeBuildInputs" >> "$out/nix-support/cygwin-buildinputs-as-runtime-deps" 15 | fi 16 | } 17 | -------------------------------------------------------------------------------- /cygwin/rebase-i686.sh: -------------------------------------------------------------------------------- 1 | fixupOutputHooks+=(_cygwinFixAutoImageBase) 2 | 3 | _cygwinFixAutoImageBase() { 4 | if [ "${dontRebase-}" == 1 ] || [ ! -d "$prefix" ]; then 5 | return 6 | fi 7 | find "$prefix" -name "*.dll" -type f | while read DLL; do 8 | if [ -f /etc/rebasenix.nextbase ]; then 9 | NEXTBASE="$(>16)+1)<<16)) 17 | 18 | echo "REBASE FIX: $DLL $BASE -> $NEXTBASE" 19 | /bin/rebase -b $NEXTBASE $DLL 20 | NEXTBASE="0x`printf %x $(($NEXTBASE+$SKIP))`" 21 | 22 | echo $NEXTBASE > /etc/rebasenix.nextbase 23 | done 24 | } 25 | -------------------------------------------------------------------------------- /cygwin/rebase-x86_64.sh: -------------------------------------------------------------------------------- 1 | fixupOutputHooks+=(_cygwinFixAutoImageBase) 2 | 3 | _cygwinFixAutoImageBase() { 4 | if [ "${dontRebase-}" == 1 ] || [ ! -d "$prefix" ]; then 5 | return 6 | fi 7 | find "$prefix" -name "*.dll" -type f | while read DLL; do 8 | if [ -f /etc/rebasenix.nextbase ]; then 9 | NEXTBASE="$(>16)+1)<<16)) 17 | 18 | echo "REBASE FIX: $DLL $BASE -> $NEXTBASE" 19 | /bin/rebase -b $NEXTBASE $DLL 20 | NEXTBASE="0x`printf %x $(($NEXTBASE+$SKIP))`" 21 | 22 | echo $NEXTBASE > /etc/rebasenix.nextbase 23 | done 24 | } 25 | -------------------------------------------------------------------------------- /darwin/bootstrap-files/aarch64-apple-darwin.nix: -------------------------------------------------------------------------------- 1 | # Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: 2 | # $ ./refresh-tarballs.bash --targets=aarch64-apple-darwin 3 | # 4 | # Metadata: 5 | # - nixpkgs revision: d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f 6 | # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.aarch64-apple-darwin.build/latest 7 | # - resolved hydra build: https://hydra.nixos.org/build/255282138 8 | # - instantiated derivation: /nix/store/cahnprnkg9z2aij3hj4rkbkc4l8190mf-stdenv-bootstrap-tools.drv 9 | # - output directory: /nix/store/zxxcz7sza5ypy061rsg7cmr7h0a96hbb-stdenv-bootstrap-tools 10 | # - build time: Wed, 03 Apr 2024 07:59:44 +0000 11 | { 12 | bootstrapTools = import { 13 | url = "http://tarballs.nixos.org/stdenv/aarch64-apple-darwin/d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f/bootstrap-tools.tar.xz"; 14 | hash = "sha256-a37OgMdTHjFyKs4UTxoD7zx6Te3A7zsSjhbFHzbNxQ8="; 15 | }; 16 | unpack = import { 17 | url = "http://tarballs.nixos.org/stdenv/aarch64-apple-darwin/d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f/unpack.nar.xz"; 18 | hash = "sha256-XCVy6TMDJ1DKFnhIT1NHzdQUjY/TPKLV67Zi/ANIpms="; 19 | name = "unpack"; 20 | unpack = true; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /darwin/bootstrap-files/x86_64-apple-darwin.nix: -------------------------------------------------------------------------------- 1 | # Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: 2 | # $ ./refresh-tarballs.bash --targets=x86_64-apple-darwin 3 | # 4 | # Metadata: 5 | # - nixpkgs revision: d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f 6 | # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.x86_64-apple-darwin.build/latest 7 | # - resolved hydra build: https://hydra.nixos.org/build/255281731 8 | # - instantiated derivation: /nix/store/44wnr0ikrbcxkakfqhhm2cz6gsh6wjni-stdenv-bootstrap-tools.drv 9 | # - output directory: /nix/store/lsl9rl3zj9nr318w471vvmlvxzj21b2k-stdenv-bootstrap-tools 10 | # - build time: Wed, 03 Apr 2024 07:56:15 +0000 11 | { 12 | bootstrapTools = import { 13 | url = "http://tarballs.nixos.org/stdenv/x86_64-apple-darwin/d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f/bootstrap-tools.tar.xz"; 14 | hash = "sha256-3OBigzlbu/Z6g8r7hsOWg95HTv7IJw9Nvbamwvw+88w="; 15 | }; 16 | unpack = import { 17 | url = "http://tarballs.nixos.org/stdenv/x86_64-apple-darwin/d03a4482228d4d6dbd2d4b425b6dfcd49ebe765f/unpack.nar.xz"; 18 | hash = "sha256-93GK8LjjgUBknxsylfGVr0DG4AbWVIQEIWrwxhDW07k="; 19 | name = "unpack"; 20 | unpack = true; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /darwin/bootstrap-tools.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | stdenv, 4 | bootstrapTools, 5 | unpack, 6 | }: 7 | 8 | builtins.derivation { 9 | inherit (stdenv.hostPlatform) system; 10 | 11 | name = "bootstrap-tools"; 12 | builder = "${unpack}/bin/bash"; 13 | 14 | args = [ 15 | "${unpack}/bootstrap-tools-unpack.sh" 16 | bootstrapTools 17 | ]; 18 | 19 | PATH = lib.makeBinPath [ 20 | (builtins.placeholder "out") 21 | unpack 22 | ]; 23 | 24 | allowedReferences = [ "out" ]; 25 | } 26 | -------------------------------------------------------------------------------- /darwin/portable-libsystem.sh: -------------------------------------------------------------------------------- 1 | # Make /nix/store/...-libSystem “portable” for static built binaries. 2 | # This just rewrites everything in $1/bin to use the 3 | # /usr/lib/libSystem.B.dylib that is provided on every macOS system. 4 | 5 | fixupOutputHooks+=('fixLibsystemRefs $prefix') 6 | 7 | fixLibsystemRefs() { 8 | if [ -d "$1/bin" ]; then 9 | find "$1/bin" -type f -exec \ 10 | @targetPrefix@install_name_tool -change @libsystem@ /usr/lib/libSystem.B.dylib {} \; 11 | fi 12 | } 13 | -------------------------------------------------------------------------------- /freebsd/always-patchelf.sh: -------------------------------------------------------------------------------- 1 | fixupOutputHooks+=(_FreeBSDPatchelfShrink) 2 | 3 | _FreeBSDPatchelfShrink() { 4 | find $prefix -type f | xargs -n1 patchelf --shrink-rpath &>/dev/null || true 5 | } 6 | -------------------------------------------------------------------------------- /freebsd/bootstrap-files/x86_64-unknown-freebsd.nix: -------------------------------------------------------------------------------- 1 | { 2 | unpack = import { 3 | url = "http://192.168.122.1:8000/result/on-server/unpack.nar.xz"; 4 | hash = "sha256-y6quCU9JKnKBdHDcUkdkM0ypWDT2cdSiqR1WqA+8ozE="; 5 | name = "boostrapUnpacked"; 6 | unpack = true; 7 | }; 8 | bootstrapTools = import { 9 | url = "http://192.168.122.1:8000/result/on-server/bootstrap-tools.tar.xz"; 10 | hash = "sha256-ypIOxsB8a/RPupki0ZTjb+vuE+ibtmS8e3DazeolHj8="; 11 | name = "bootstrapTools.tar.xz"; 12 | }; 13 | } 14 | -------------------------------------------------------------------------------- /freebsd/linkBootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | for path in $paths; do 4 | if ! [ -e "$src/$path" ]; then 5 | echo "Error: $path does not exist" 6 | exit 1 7 | fi 8 | mkdir -p $out/$(dirname $path) 9 | ln -s $src/$path $out/$path 10 | done 11 | -------------------------------------------------------------------------------- /freebsd/make-bootstrap-tools-cross.nix: -------------------------------------------------------------------------------- 1 | {system ? builtins.currentSystem}: 2 | 3 | let 4 | inherit (releaseLib) lib; 5 | releaseLib = import ../../top-level/release-lib.nix { 6 | # We're not using any functions from release-lib.nix that look at 7 | # supportedSystems. 8 | supportedSystems = []; 9 | }; 10 | 11 | make = crossSystem: import ./make-bootstrap-tools.nix { 12 | pkgs = releaseLib.pkgsForCross crossSystem system; 13 | }; 14 | in lib.mapAttrs (n: make) (with lib.systems.examples; { 15 | # NOTE: Only add platforms for which there are files in `./bootstrap-files` 16 | # or for which you plan to request the tarball upload soon. See the 17 | # maintainers/scripts/bootstrap-files/README.md 18 | # on how to request an upload. 19 | # Sort following the sorting in `./default.nix` `bootstrapFiles` argument. 20 | 21 | x86_64-unknown-freebsd = x86_64-freebsd; 22 | }) 23 | -------------------------------------------------------------------------------- /generic/builder.sh: -------------------------------------------------------------------------------- 1 | export PATH= 2 | for i in $initialPath; do 3 | if [ "$i" = / ]; then i=; fi 4 | PATH=$PATH${PATH:+:}$i/bin 5 | done 6 | 7 | mkdir $out 8 | 9 | { 10 | echo "export SHELL=$shell" 11 | echo "initialPath=\"$initialPath\"" 12 | echo "defaultNativeBuildInputs=\"$defaultNativeBuildInputs\"" 13 | echo "defaultBuildInputs=\"$defaultBuildInputs\"" 14 | echo "$preHook" 15 | cat "$setup" 16 | } > "$out/setup" 17 | 18 | # Allow the user to install stdenv using nix-env and get the packages 19 | # in stdenv. 20 | mkdir $out/nix-support 21 | if [ "$propagatedUserEnvPkgs" ]; then 22 | printf '%s ' $propagatedUserEnvPkgs > $out/nix-support/propagated-user-env-packages 23 | fi 24 | -------------------------------------------------------------------------------- /generic/common-path.nix: -------------------------------------------------------------------------------- 1 | {pkgs}: [ 2 | pkgs.coreutils 3 | pkgs.findutils 4 | pkgs.diffutils 5 | pkgs.gnused 6 | pkgs.gnugrep 7 | pkgs.gawk 8 | pkgs.gnutar 9 | pkgs.gzip 10 | pkgs.bzip2.bin 11 | pkgs.gnumake 12 | pkgs.bash 13 | pkgs.patch 14 | pkgs.xz.bin 15 | 16 | # The `file` command is added here because an enormous number of 17 | # packages have a vendored dependency upon `file` in their 18 | # `./configure` script, due to libtool<=2.4.6, or due to 19 | # libtool>=2.4.7 in which the package author decided to set FILECMD 20 | # when running libtoolize. In fact, file-5.4.6 *depends on itself* 21 | # and tries to invoke `file` from its own ./configure script. 22 | pkgs.file 23 | ] 24 | -------------------------------------------------------------------------------- /generic/default-builder.sh: -------------------------------------------------------------------------------- 1 | if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi 2 | 3 | source $stdenv/setup 4 | genericBuild 5 | -------------------------------------------------------------------------------- /lib.nix: -------------------------------------------------------------------------------- 1 | let 2 | lib = import (builtins.fetchGit { 3 | url = "https://github.com/jonringer/nix-lib.git"; 4 | rev = "f3baad9fc4df31152e6150712204bb391214fdd7"; 5 | }); 6 | in lib.extend(self: _: { 7 | systems = import ./systems { lib = self; }; 8 | 9 | # Backwards compatibly alias 10 | platforms = self.systems.doubles; 11 | 12 | # This repo is curated as a set, references to a particular maintainer is 13 | # likely an error 14 | maintainers = { }; 15 | }) 16 | -------------------------------------------------------------------------------- /linux/bootstrap-files/aarch64-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | { 2 | busybox = import { 3 | url = "http://tarballs.nixos.org/stdenv-linux/aarch64/21ec906463ea8f11abf3f9091ddd4c3276516e58/busybox"; 4 | executable = true; 5 | hash = "sha256-0MuIeQlBUaeisqoFSu8y+8oB6K4ZG5Lhq8RcS9JqkFQ="; 6 | }; 7 | bootstrapTools = import { 8 | url = "http://tarballs.nixos.org/stdenv-linux/aarch64/21ec906463ea8f11abf3f9091ddd4c3276516e58/bootstrap-tools.tar.xz"; 9 | hash = "sha256-aJvtsWeuQHbb14BGZ2EiOKzjQn46h3x3duuPEawG0eE="; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /linux/bootstrap-files/aarch64-unknown-linux-musl.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/246470544 5 | # 6 | # …which used nixpkgs revision dd5621df6dcb90122b50da5ec31c411a0de3e538 7 | # to instantiate: 8 | # 9 | # /nix/store/g480ass2vjmakaq03z7k2j95xnxh206a-stdenv-bootstrap-tools.drv 10 | # 11 | # …and then built: 12 | # 13 | # /nix/store/95lm0y33dayag4542s8bi83s31bw68dr-stdenv-bootstrap-tools 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/dd5621df6dcb90122b50da5ec31c411a0de3e538/busybox"; 18 | sha256 = "sha256-WuOaun7U5enbOy8SuuCo6G1fbGwsO16jhy/oM8K0lAs="; 19 | executable = true; 20 | }; 21 | bootstrapTools = import { 22 | url = "http://tarballs.nixos.org/stdenv/aarch64-unknown-linux-musl/dd5621df6dcb90122b50da5ec31c411a0de3e538/bootstrap-tools.tar.xz"; 23 | hash = "sha256-ZY9IMOmx1VOn6uoFDpdJbTnPX59TEkrVCzWNtjQ8/QE="; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /linux/bootstrap-files/armv5tel-unknown-linux-gnueabi.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Note: do not use Hydra as a source URL. Ask a member of the 3 | # infrastructure team to mirror the job. 4 | busybox = import { 5 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv5tel.dist/latest 6 | # from build: https://hydra.nixos.org/build/114203025 7 | url = "http://tarballs.nixos.org/stdenv-linux/armv5tel/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox"; 8 | # note: the following hash is different than the above hash, due to executable = true 9 | sha256 = "0qxp2fsvs4phbc17g9npj9bsm20ylr8myi5pivcrmxm5qqflgi8d"; 10 | executable = true; 11 | }; 12 | bootstrapTools = import { 13 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv5tel.dist/latest 14 | # from build: https://hydra.nixos.org/build/114203025 15 | url = "http://tarballs.nixos.org/stdenv-linux/armv5tel/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz"; 16 | sha256 = "28327343db5ecc7f7811449ec69280d5867fa5d1d377cab0426beb9d4e059ed6"; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /linux/bootstrap-files/armv6l-unknown-linux-gnueabihf.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Note: do not use Hydra as a source URL. Ask a member of the 3 | # infrastructure team to mirror the job. 4 | busybox = import { 5 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv6l.dist/latest 6 | # from build: https://hydra.nixos.org/build/114202834 7 | url = "http://tarballs.nixos.org/stdenv-linux/armv6l/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox"; 8 | # note: the following hash is different than the above hash, due to executable = true 9 | sha256 = "1q02537cq56wlaxbz3s3kj5vmh6jbm27jhvga6b4m4jycz5sxxp6"; 10 | executable = true; 11 | }; 12 | bootstrapTools = import { 13 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv6l.dist/latest 14 | # from build: https://hydra.nixos.org/build/114202834 15 | url = "http://tarballs.nixos.org/stdenv-linux/armv6l/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz"; 16 | sha256 = "0810fe74f8cd09831f177d075bd451a66b71278d3cc8db55b07c5e38ef3fbf3f"; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /linux/bootstrap-files/armv6l-unknown-linux-musleabihf.nix: -------------------------------------------------------------------------------- 1 | { 2 | busybox = import { 3 | url = "https://wdtz.org/files/xmz441m69qrlfdw47l2k10zf87fsya6r-stdenv-bootstrap-tools-armv6l-unknown-linux-musleabihf/on-server/busybox"; 4 | sha256 = "01d0hp1xgrriiy9w0sd9vbqzwxnpwiyah80pi4vrpcmbwji36j1i"; 5 | executable = true; 6 | }; 7 | bootstrapTools = import { 8 | url = "https://wdtz.org/files/xmz441m69qrlfdw47l2k10zf87fsya6r-stdenv-bootstrap-tools-armv6l-unknown-linux-musleabihf/on-server/bootstrap-tools.tar.xz"; 9 | sha256 = "1r9mz9w8y5jd7gfwfsrvs20qarzxy7bvrp5dlm41hnx6z617if1h"; 10 | }; 11 | } 12 | -------------------------------------------------------------------------------- /linux/bootstrap-files/armv7l-unknown-linux-gnueabihf.nix: -------------------------------------------------------------------------------- 1 | { 2 | # Note: do not use Hydra as a source URL. Ask a member of the 3 | # infrastructure team to mirror the job. 4 | busybox = import { 5 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv7l.dist/latest 6 | # from build: https://hydra.nixos.org/build/114203060 7 | url = "http://tarballs.nixos.org/stdenv-linux/armv7l/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/busybox"; 8 | # note: the following hash is different than the above hash, due to executable = true 9 | sha256 = "18qc6w2yykh7nvhjklsqb2zb3fjh4p9r22nvmgj32jr1mjflcsjn"; 10 | executable = true; 11 | }; 12 | bootstrapTools = import { 13 | # from job: https://hydra.nixos.org/job/nixpkgs/cross-trunk/bootstrapTools.armv7l.dist/latest 14 | # from build: https://hydra.nixos.org/build/114203060 15 | url = "http://tarballs.nixos.org/stdenv-linux/armv7l/0eb0ddc4dbe3cd5415c6b6e657538eb809fc3778/bootstrap-tools.tar.xz"; 16 | sha256 = "cf2968e8085cd3e6b3e9359624060ad24d253800ede48c5338179f6e0082c443"; 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /linux/bootstrap-files/i686-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | # Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: 2 | # $ ./refresh-tarballs.bash --targets=i686-unknown-linux-gnu 3 | # 4 | # Metadata: 5 | # - nixpkgs revision: 125cefd4cf8f857e5ff1aceaef9230ba578a033d 6 | # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.i686-unknown-linux-gnu.build/latest 7 | # - resolved hydra build: https://hydra.nixos.org/build/247889988 8 | # - instantiated derivation: /nix/store/chcf0brhdyn7ihmb14n0w4rm2a59gqrw-stdenv-bootstrap-tools.drv 9 | # - output directory: /nix/store/5x6dldhza7if5s6wsicaxa8fbndyixps-stdenv-bootstrap-tools 10 | # - build time: Fri, 26 Jan 2024 22:04:03 +0000 11 | { 12 | bootstrapTools = import { 13 | url = "http://tarballs.nixos.org/stdenv/i686-unknown-linux-gnu/125cefd4cf8f857e5ff1aceaef9230ba578a033d/bootstrap-tools.tar.xz"; 14 | hash = "sha256-KTAh3t91aJMiMO/7NFOjUz6fXI9Iu+H7cuODreWz9N8="; 15 | }; 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv/i686-unknown-linux-gnu/125cefd4cf8f857e5ff1aceaef9230ba578a033d/busybox"; 18 | hash = "sha256-omz+ZT0bhMkAZcDs9evA2PNpO6VHUozdtjMgdui6fxw="; 19 | executable = true; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /linux/bootstrap-files/mips64el-unknown-linux-gnuabi64.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/182757245 5 | # 6 | # Which used nixpkgs revision ef3fe254f3c59455386bc92fe84164f9679b92b1 7 | # to instantiate: 8 | # 9 | # /nix/store/a2bvv663wjnyhq8m7v84aspsd3sgf9h6-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabi64.drv 10 | # 11 | # and then built: 12 | # 13 | # /nix/store/aw3dmsrh22831l83vi3q9apg9qi3x8ms-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabi64 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv-linux/mips64el/ef3fe254f3c59455386bc92fe84164f9679b92b1/busybox"; 18 | sha256 = "sha256-sTE58ofjqAqX3Xtq1g9wDxzIe6Vo//GHbicfqJoivDI="; 19 | executable = true; 20 | }; 21 | bootstrapTools =import { 22 | url = "http://tarballs.nixos.org/stdenv-linux/mips64el/ef3fe254f3c59455386bc92fe84164f9679b92b1/bootstrap-tools.tar.xz"; 23 | sha256 = "sha256-tTgjeXpd2YgnfP4JvRuO0bXd2j8GqzBcd57JI3wH9x0="; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /linux/bootstrap-files/mips64el-unknown-linux-gnuabin32.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/188389586 5 | # 6 | # Which used nixpkgs revision 97d9c84e1df4397b43ecb39359f1bd003cd44585 7 | # to instantiate: 8 | # 9 | # /nix/store/hakn8s85s9011v61r6svp5qy8x1y64fv-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32.drv 10 | # 11 | # and then built: 12 | # 13 | # /nix/store/rjgybpnf3yiqyhvl2n2lx31jf800fii2-stdenv-bootstrap-tools-mips64el-unknown-linux-gnuabin32 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv-linux/mips64el-n32/97d9c84e1df4397b43ecb39359f1bd003cd44585/busybox"; 18 | sha256 = "sha256-4N3G1qYA7vitjhsIW17pR6UixIuzrq4vZXa8F0/X4iI="; 19 | executable = true; 20 | }; 21 | bootstrapTools = import { 22 | url = "http://tarballs.nixos.org/stdenv-linux/mips64el-n32/97d9c84e1df4397b43ecb39359f1bd003cd44585/bootstrap-tools.tar.xz"; 23 | sha256 = "sha256-LWrpN6su2yNVurUyhZP34OiZyzgh7MfN13fIIbou8KI="; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /linux/bootstrap-files/mipsel-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/185311909 5 | # 6 | # Which used nixpkgs revision 5bd14b3cfe2f87a2e2b074645aba39c69563e4bc 7 | # to instantiate: 8 | # 9 | # /nix/store/184fa520zv8ls9fzcqyfa5dmkp8kf6xr-stdenv-bootstrap-tools-mipsel-unknown-linux-gnu.drv 10 | # 11 | # and then built: 12 | # 13 | # /nix/store/i46mrzinxi9a5incliwhksmk947ff4wn-stdenv-bootstrap-tools-mipsel-unknown-linux-gnu 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv-linux/mipsel/5bd14b3cfe2f87a2e2b074645aba39c69563e4bc/busybox"; 18 | hash = "sha256-EhuzjL52VEIOfEcFdVGZaDMClQbMc9V9ISrTUNaA7HQ="; 19 | executable = true; 20 | }; 21 | bootstrapTools = import { 22 | url = "http://tarballs.nixos.org/stdenv-linux/mipsel/5bd14b3cfe2f87a2e2b074645aba39c69563e4bc/bootstrap-tools.tar.xz"; 23 | hash = "sha256-OEGgLJOLnV+aobsb+P8mY3Dp8qbeVODBH6x3aUE/MGM="; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /linux/bootstrap-files/powerpc64le-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/186237511 5 | # 6 | # Which used nixpkgs revision ac43c444780a80e789fd14fe2114acd4a3b5cf9d 7 | # to instantiate: 8 | # 9 | # /nix/store/nhjbza9vlcyhp9zxfz6lwpc3m2ghrpzj-stdenv-bootstrap-tools-powerpc64le-unknown-linux-gnu.drv 10 | # 11 | # and then built: 12 | # 13 | # /nix/store/fklpm7fy6cp5wz55w0gd8wakyqvzapjx-stdenv-bootstrap-tools-powerpc64le-unknown-linux-gnu 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv-linux/powerpc64le/ac43c444780a80e789fd14fe2114acd4a3b5cf9d/busybox"; 18 | sha256 = "sha256-jtPEAsht4AUAG4MLK8xocQSfveUR4ppU1lS4bGI1VN4="; 19 | executable = true; 20 | }; 21 | bootstrapTools = import { 22 | url = "http://tarballs.nixos.org/stdenv-linux/powerpc64le/ac43c444780a80e789fd14fe2114acd4a3b5cf9d/bootstrap-tools.tar.xz"; 23 | sha256 = "sha256-MpIDnpZUK3M17qlnuoxfnK0EgxRosm3TMW1WfPZ1+jU="; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /linux/bootstrap-files/riscv64-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | # 2 | # Files came from this Hydra build: 3 | # 4 | # https://hydra.nixos.org/build/246376732 5 | # 6 | # Which used nixpkgs revision 160cedc144aced7a35a91440b46b74ffacd52682 7 | # to instantiate: 8 | # 9 | # /nix/store/cpiajh4l83b08pynwiwkpxj53d78pcxr-stdenv-bootstrap-tools-riscv64-unknown-linux-gnu.drv 10 | # 11 | # and then built: 12 | # 13 | # /nix/store/8a92pj40awdw585mcb9dvm4nyb03k3q3-stdenv-bootstrap-tools-riscv64-unknown-linux-gnu 14 | # 15 | { 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv-linux/riscv64/160cedc144aced7a35a91440b46b74ffacd52682/busybox"; 18 | sha256 = "sha256-OGO96QUzs2n5pGipn/V87AxzUY9OWKZl417nE8HdZIE="; 19 | executable = true; 20 | }; 21 | 22 | bootstrapTools = import { 23 | url = "http://tarballs.nixos.org/stdenv-linux/riscv64/160cedc144aced7a35a91440b46b74ffacd52682/bootstrap-tools.tar.xz"; 24 | sha256 = "sha256-0LxRd7fdafQezNJ+N2tuOfm0KEwgfRSts5fhP0e0r0s="; 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /linux/bootstrap-files/x86_64-unknown-linux-gnu.nix: -------------------------------------------------------------------------------- 1 | # Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: 2 | # $ ./refresh-tarballs.bash --targets=x86_64-unknown-linux-gnu 3 | # 4 | # Metadata: 5 | # - nixpkgs revision: 82b583ba2ba2e5706b35dbe23f31362e62be2a9d 6 | # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.x86_64-unknown-linux-gnu.build/latest 7 | # - resolved hydra build: https://hydra.nixos.org/build/249165517 8 | # - instantiated derivation: /nix/store/7g8mrv13mi4zrx66fw0hy4c46j752wfd-stdenv-bootstrap-tools.drv 9 | # - output directory: /nix/store/dw6vr6m5w7ysrdrbs0s5wdgbjmbnr7gx-stdenv-bootstrap-tools 10 | # - build time: Sat, 10 Feb 2024 01:29:55 +0000 11 | { 12 | bootstrapTools = import { 13 | url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/bootstrap-tools.tar.xz"; 14 | hash = "sha256-YQlr088HPoVWBU2jpPhpIMyOyoEDZYDw1y60SGGbUM0="; 15 | }; 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-gnu/82b583ba2ba2e5706b35dbe23f31362e62be2a9d/busybox"; 18 | hash = "sha256-QrTEnQTBM1Y/qV9odq8irZkQSD9uOMbs2Q5NgCvKCNQ="; 19 | executable = true; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /linux/bootstrap-files/x86_64-unknown-linux-musl.nix: -------------------------------------------------------------------------------- 1 | # Autogenerated by maintainers/scripts/bootstrap-files/refresh-tarballs.bash as: 2 | # $ ./refresh-tarballs.bash --targets=x86_64-unknown-linux-musl 3 | # 4 | # Metadata: 5 | # - nixpkgs revision: 125cefd4cf8f857e5ff1aceaef9230ba578a033d 6 | # - hydra build: https://hydra.nixos.org/job/nixpkgs/trunk/stdenvBootstrapTools.x86_64-unknown-linux-musl.build/latest 7 | # - resolved hydra build: https://hydra.nixos.org/build/247890807 8 | # - instantiated derivation: /nix/store/gqri9n85rsf2983r6m8lkz0h69k4n7xi-stdenv-bootstrap-tools.drv 9 | # - output directory: /nix/store/b0x0qcbf1gsp50jzw52sbbgdp3jlwcjf-stdenv-bootstrap-tools 10 | # - build time: Fri, 26 Jan 2024 22:09:22 +0000 11 | { 12 | bootstrapTools = import { 13 | url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/125cefd4cf8f857e5ff1aceaef9230ba578a033d/bootstrap-tools.tar.xz"; 14 | hash = "sha256-t0W2MR7UwtPyYEGcRo9UOuXfaP4uUZKZXEmYGcBOuOA="; 15 | }; 16 | busybox = import { 17 | url = "http://tarballs.nixos.org/stdenv/x86_64-unknown-linux-musl/125cefd4cf8f857e5ff1aceaef9230ba578a033d/busybox"; 18 | hash = "sha256-0U2r3EU61oqhs+oyzFABIFTCVqXOWSP0qEtnyHwjzm0="; 19 | executable = true; 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /linux/bootstrap-tools/default.nix: -------------------------------------------------------------------------------- 1 | { 2 | lib, 3 | libc, 4 | config, 5 | system, 6 | bootstrapFiles, 7 | isFromBootstrapFiles ? false, 8 | }: 9 | 10 | let 11 | maybeDenoteProvenance = lib.optionalAttrs isFromBootstrapFiles { 12 | passthru = { 13 | inherit isFromBootstrapFiles; 14 | }; 15 | }; 16 | 17 | maybeContentAddressed = lib.optionalAttrs config.contentAddressedByDefault { 18 | __contentAddressed = true; 19 | outputHashAlgo = "sha256"; 20 | outputHashMode = "recursive"; 21 | }; 22 | 23 | args = { 24 | inherit system bootstrapFiles; 25 | extraAttrs = maybeContentAddressed; 26 | }; 27 | result = 28 | if libc == "glibc" then 29 | import ./glibc.nix args 30 | else if libc == "musl" then 31 | import ./musl.nix args 32 | else 33 | throw "unsupported libc"; 34 | in 35 | result // maybeDenoteProvenance 36 | -------------------------------------------------------------------------------- /linux/bootstrap-tools/glibc.nix: -------------------------------------------------------------------------------- 1 | { 2 | system, 3 | bootstrapFiles, 4 | extraAttrs, 5 | }: 6 | 7 | derivation ( 8 | { 9 | name = "bootstrap-tools"; 10 | 11 | builder = bootstrapFiles.busybox; 12 | 13 | args = [ 14 | "ash" 15 | "-e" 16 | ./glibc/unpack-bootstrap-tools.sh 17 | ]; 18 | 19 | tarball = bootstrapFiles.bootstrapTools; 20 | 21 | inherit system; 22 | 23 | # Needed by the GCC wrapper. 24 | langC = true; 25 | langCC = true; 26 | isGNU = true; 27 | hardeningUnsupportedFlags = [ 28 | "fortify3" 29 | "shadowstack" 30 | "pacret" 31 | "stackclashprotection" 32 | "trivialautovarinit" 33 | "zerocallusedregs" 34 | ]; 35 | } 36 | // extraAttrs 37 | ) 38 | -------------------------------------------------------------------------------- /linux/bootstrap-tools/musl.nix: -------------------------------------------------------------------------------- 1 | { 2 | system, 3 | bootstrapFiles, 4 | extraAttrs, 5 | }: 6 | 7 | derivation ( 8 | { 9 | name = "bootstrap-tools"; 10 | 11 | builder = bootstrapFiles.busybox; 12 | 13 | args = [ 14 | "ash" 15 | "-e" 16 | ./musl/unpack-bootstrap-tools.sh 17 | ]; 18 | 19 | tarball = bootstrapFiles.bootstrapTools; 20 | 21 | inherit system; 22 | 23 | # Needed by the GCC wrapper. 24 | langC = true; 25 | langCC = true; 26 | isGNU = true; 27 | hardeningUnsupportedFlags = [ 28 | "fortify3" 29 | "shadowstack" 30 | "pacret" 31 | "zerocallusedregs" 32 | "trivialautovarinit" 33 | ]; 34 | } 35 | // extraAttrs 36 | ) 37 | -------------------------------------------------------------------------------- /os-specific/linux/kernel-headers/no-relocs.patch: -------------------------------------------------------------------------------- 1 | --- a/arch/x86/Makefile 2 | +++ b/arch/x86/Makefile 3 | @@ -231,3 +231,3 @@ endif 4 | archscripts: scripts_basic 5 | - $(Q)$(MAKE) $(build)=arch/x86/tools relocs 6 | + $(Q)$(MAKE) $(build)=arch/x86/tools 7 | 8 | -------------------------------------------------------------------------------- /pkgs/acl/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, gettext, attr }: 2 | 3 | # Note: this package is used for bootstrapping fetchurl, and thus 4 | # cannot use fetchpatch! All mutable patches (generated by GitHub or 5 | # cgit) that are needed here should be included directly in Nixpkgs as 6 | # files. 7 | 8 | stdenv.mkDerivation rec { 9 | pname = "acl"; 10 | version = "2.3.2"; 11 | 12 | src = fetchurl { 13 | url = "mirror://savannah/acl/acl-${version}.tar.gz"; 14 | hash = "sha256-XyvbrWKXB6p9hcYj+ZSqih0t7FWnPeUgW6wL9gWKL3w="; 15 | }; 16 | 17 | outputs = [ "bin" "dev" "out" "man" "doc" ]; 18 | 19 | nativeBuildInputs = [ gettext ]; 20 | buildInputs = [ attr ]; 21 | 22 | postPatch = '' 23 | patchShebangs . 24 | ''; 25 | 26 | meta = with lib; { 27 | inherit (attr.meta) platforms badPlatforms; 28 | homepage = "https://savannah.nongnu.org/projects/acl"; 29 | description = "Library and tools for manipulating access control lists"; 30 | license = licenses.gpl2Plus; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /pkgs/aliases.nix: -------------------------------------------------------------------------------- 1 | { lib, noSysDirs, config, overlays }: 2 | 3 | res: final: prev: { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /pkgs/attr/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, gettext }: 2 | 3 | # Note: this package is used for bootstrapping fetchurl, and thus 4 | # cannot use fetchpatch! All mutable patches (generated by GitHub or 5 | # cgit) that are needed here should be included directly in Nixpkgs as 6 | # files. 7 | 8 | stdenv.mkDerivation rec { 9 | pname = "attr"; 10 | version = "2.5.2"; 11 | 12 | src = fetchurl { 13 | url = "mirror://savannah/attr/${pname}-${version}.tar.gz"; 14 | sha256 = "sha256-Ob9nRS+kHQlIwhl2AQU/SLPXigKTiXNDMqYwmmgMbIc="; 15 | }; 16 | 17 | outputs = [ "bin" "dev" "out" "man" "doc" ]; 18 | 19 | nativeBuildInputs = [ gettext ]; 20 | 21 | postPatch = '' 22 | for script in install-sh include/install-sh; do 23 | patchShebangs $script 24 | done 25 | ''; 26 | 27 | meta = with lib; { 28 | homepage = "https://savannah.nongnu.org/projects/attr/"; 29 | description = "Library and tools for manipulating extended attributes"; 30 | platforms = platforms.linux; 31 | badPlatforms = platforms.microblaze; 32 | license = licenses.gpl2Plus; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/autoconf-archive/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, xz }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "autoconf-archive"; 5 | version = "2023.02.20"; 6 | 7 | src = fetchurl { 8 | url = "mirror://gnu/autoconf-archive/autoconf-archive-${version}.tar.xz"; 9 | hash = "sha256-cdQEhHmuKPH1eUYZw9ct+cAd9JscYo74X943WW3DGjM="; 10 | }; 11 | 12 | strictDeps = true; 13 | enableParallelBuilding = true; 14 | 15 | buildInputs = [ xz ]; 16 | 17 | meta = with lib; { 18 | description = "Archive of autoconf m4 macros"; 19 | homepage = "https://www.gnu.org/software/autoconf-archive/"; 20 | license = licenses.gpl3; 21 | platforms = platforms.unix; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/automake/fix-perl-5.26.patch: -------------------------------------------------------------------------------- 1 | --- automake-1.11.2/automake.in 2 | +++ automake-1.11.2/automake.in 3 | @@ -4156,7 +4156,7 @@ sub substitute_ac_subst_variables_worker($) 4 | sub substitute_ac_subst_variables ($) 5 | { 6 | my ($text) = @_; 7 | - $text =~ s/\${([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; 8 | + $text =~ s/\$\{([^ \t=:+{}]+)}/&substitute_ac_subst_variables_worker ($1)/ge; 9 | return $text; 10 | } 11 | -------------------------------------------------------------------------------- /pkgs/automake/fix-test-autoconf-2.69.patch: -------------------------------------------------------------------------------- 1 | With Autoconf 2.69 (instead of 2.68), config.{guess,sub} are needed. 2 | 3 | --- automake-1.11.2/tests/compile_f90_c_cxx.test 2011-12-20 21:56:29.000000000 +0100 4 | +++ automake-1.11.2/tests/compile_f90_c_cxx.test 2012-07-07 13:35:58.000000000 +0200 5 | @@ -41,7 +41,7 @@ END 6 | : > baz.cc 7 | 8 | $ACLOCAL 9 | -$AUTOMAKE 10 | +$AUTOMAKE --add-missing 11 | 12 | # Look for the macros at the beginning of rules. Be careful, as there 13 | # are literal tabs at the beginning of the search strings. 14 | -------------------------------------------------------------------------------- /pkgs/automake/setup-hook.sh: -------------------------------------------------------------------------------- 1 | addAclocals () { 2 | addToSearchPathWithCustomDelimiter : ACLOCAL_PATH $1/share/aclocal 3 | } 4 | 5 | addEnvHooks "$hostOffset" addAclocals 6 | -------------------------------------------------------------------------------- /pkgs/bash/fix-pop-var-context-error.patch: -------------------------------------------------------------------------------- 1 | Excerpted from . 2 | 3 | Original author: Chet Ramey 4 | 5 | --- variables.c 6 | +++ variables.c 7 | @@ -5413,7 +5413,9 @@ pop_var_context () 8 | vcxt = shell_variables; 9 | if (vc_isfuncenv (vcxt) == 0) 10 | { 11 | - internal_error (_("pop_var_context: head of shell_variables not a function context")); 12 | + /* If we haven't flushed all of the local contexts already, flag an error */ 13 | + if (shell_variables != global_variables || variable_context > 0) 14 | + internal_error (_("pop_var_context: head of shell_variables not a function context")); 15 | return; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /pkgs/bash/fzf-obc/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchFromGitHub }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "fzf-obc"; 5 | version = "1.3.0"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "rockandska"; 9 | repo = pname; 10 | rev = version; 11 | sha256 = "sha256-KIAlDpt1Udl+RLp3728utgQ9FCjZz/OyoG92MOJmgPI="; 12 | }; 13 | 14 | dontBuild = true; 15 | 16 | installPhase = '' 17 | mkdir -p $out/share/fzf-obc/{bin,lib/fzf-obc,plugins/{kill,gradle}} 18 | install -m644 bin/* $out/share/fzf-obc/bin 19 | install -m644 lib/fzf-obc/* $out/share/fzf-obc/lib/fzf-obc 20 | install -m644 plugins/kill/* $out/share/fzf-obc/plugins/kill 21 | install -m644 plugins/gradle/* $out/share/fzf-obc/plugins/gradle 22 | ''; 23 | 24 | meta = with lib; { 25 | homepage = "https://fzf-obc.readthedocs.io"; 26 | description = "Completion script adding fzf over all know bash completion functions"; 27 | license = licenses.unfree; 28 | maintainers = with maintainers; [ loicreynier ]; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /pkgs/bash/parallel.patch: -------------------------------------------------------------------------------- 1 | From https://savannah.gnu.org/patch/index.php?10373 2 | https://savannah.gnu.org/patch/download.php?file_id=54964 3 | --- Makefile.in 4 | +++ Makefile.in 5 | @@ -1432,6 +1432,7 @@ siglist.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 6 | subst.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 7 | test.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 8 | trap.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 9 | +unwind_prot.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 10 | variables.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 11 | version.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 12 | xmalloc.o: bashintl.h ${LIBINTL_H} $(BASHINCDIR)/gettext.h 13 | -------------------------------------------------------------------------------- /pkgs/bash/pgrp-pipe-5.patch: -------------------------------------------------------------------------------- 1 | --- ./configure 2022-12-20 17:13:17.804045620 +0100 2 | +++ ./configure-fixed 2022-12-20 17:16:00.444114824 +0100 3 | @@ -21723,11 +21723,7 @@ 4 | solaris2*) LOCAL_CFLAGS=-DSOLARIS ;; 5 | lynxos*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;; 6 | linux*) LOCAL_LDFLAGS=-rdynamic # allow dynamic loading 7 | - case "`uname -r`" in 8 | - 1.*|2.[0123]*) : ;; 9 | - *) printf "%s\n" "#define PGRP_PIPE 1" >>confdefs.h 10 | - ;; 11 | - esac ;; 12 | + printf "%s\n" "#define PGRP_PIPE 1" >>confdefs.h ;; 13 | netbsd*|openbsd*) LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;; 14 | freebsd*|midnightbsd*) LOCAL_CFLAGS='-DHEREDOC_PIPESIZE=4096' ;; 15 | *qnx[67]*) LOCAL_LIBS="-lncurses" ;; 16 | -------------------------------------------------------------------------------- /pkgs/bash/yarn-completion/default.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , stdenv 3 | , fetchFromGitHub 4 | , installShellFiles 5 | }: 6 | 7 | stdenv.mkDerivation rec { 8 | pname = "yarn-bash-completion"; 9 | version = "0.17.0"; 10 | 11 | src = fetchFromGitHub { 12 | owner = "dsifford"; 13 | repo = "yarn-completion"; 14 | rev = "v${version}"; 15 | sha256 = "0xflbrbwskjqv3knvc8jqygpvfxh5ak66q7w22d1ng8gwrfqzcng"; 16 | }; 17 | 18 | strictDeps = true; 19 | nativeBuildInputs = [ installShellFiles ]; 20 | 21 | installPhase = '' 22 | runHook preInstall 23 | 24 | installShellCompletion --cmd yarn ./yarn-completion.bash 25 | 26 | runHook postInstall 27 | ''; 28 | 29 | meta = with lib; { 30 | homepage = "https://github.com/dsifford/yarn-completion/"; 31 | description = "Bash completion for Yarn"; 32 | license = licenses.mit; 33 | maintainers = with maintainers; [ DamienCassou ]; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /pkgs/binutils/0001-libtool.m4-update-macos-version-detection-block.patch: -------------------------------------------------------------------------------- 1 | From 368f26bfece3899a8c992cfec66427266918ab80 Mon Sep 17 00:00:00 2001 2 | From: Randy Eckenrode 3 | Date: Thu, 4 Jul 2024 12:20:34 -0400 4 | Subject: [PATCH] libtool.m4: update macos version detection block 5 | 6 | --- 7 | libtool.m4 | 1 + 8 | 1 file changed, 1 insertion(+) 9 | 10 | diff --git a/libtool.m4 b/libtool.m4 11 | index e36fdd3c0e2..dd4725f8cd1 100644 12 | --- a/libtool.m4 13 | +++ b/libtool.m4 14 | @@ -1011,6 +1011,7 @@ _LT_EOF 15 | _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' 16 | ;; 17 | *) 18 | + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}dynamic_lookup' 19 | ;; 20 | esac 21 | ;; 22 | -- 23 | 2.45.1 24 | 25 | -------------------------------------------------------------------------------- /pkgs/binutils/2.38/always-search-rpath.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ld/genscripts.sh b/ld/genscripts.sh 2 | index b6940d376d..0feb1adfd0 100755 3 | --- a/ld/genscripts.sh 4 | +++ b/ld/genscripts.sh 5 | @@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then 6 | USE_LIBPATH=yes 7 | fi 8 | 9 | +# TODO: why is this needed? 10 | +USE_LIBPATH=yes 11 | + 12 | # Set the library search path, for libraries named by -lfoo. 13 | # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used. 14 | # Otherwise, the default is set here. 15 | -------------------------------------------------------------------------------- /pkgs/binutils/2.38/deterministic.patch: -------------------------------------------------------------------------------- 1 | diff -ur orig/binutils-2.23.1/ld/ldlang.c binutils-2.23.1/ld/ldlang.c 2 | --- orig/ld/ldlang.c 3 | +++ new/ld/ldlang.c 4 | @@ -3095,6 +3095,8 @@ 5 | ldfile_output_machine)) 6 | einfo (_("%P%F:%s: can not set architecture: %E\n"), name); 7 | 8 | + link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; 9 | + 10 | link_info.hash = bfd_link_hash_table_create (link_info.output_bfd); 11 | if (link_info.hash == NULL) 12 | einfo (_("%P%F: can not create hash table: %E\n")); 13 | -------------------------------------------------------------------------------- /pkgs/binutils/2.38/windres-locate-gcc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/binutils/resrc.c b/binutils/resrc.c 2 | index a875c3a4..0411d047 100644 3 | --- a/binutils/resrc.c 4 | +++ b/binutils/resrc.c 5 | @@ -521,7 +521,13 @@ read_rc_file (const char *filename, const char *preprocessor, 6 | 7 | cpp_pipe = 0; 8 | 9 | - if (dash) 10 | + /* Nixpkgs specific : look first at the prefixed path 11 | + ( there should be no gcc in the binutils folder ) */ 12 | + if (slash && dash) { 13 | + cpp_pipe = look_for_default(cmd, slash + 1, dash - slash, preprocargs, filename); 14 | + } 15 | + 16 | + if (dash && ! cpp_pipe) 17 | { 18 | /* First, try looking for a prefixed gcc in the windres 19 | directory, with the same prefix as windres */ 20 | -------------------------------------------------------------------------------- /pkgs/binutils/always-search-rpath.patch: -------------------------------------------------------------------------------- 1 | diff --git a/ld/genscripts.sh b/ld/genscripts.sh 2 | index b6940d376d..0feb1adfd0 100755 3 | --- a/ld/genscripts.sh 4 | +++ b/ld/genscripts.sh 5 | @@ -125,6 +125,9 @@ if test "x$NATIVE" = "xyes" ; then 6 | USE_LIBPATH=yes 7 | fi 8 | 9 | +# TODO: why is this needed? 10 | +USE_LIBPATH=yes 11 | + 12 | # Set the library search path, for libraries named by -lfoo. 13 | # If LIB_PATH is defined (e.g., by Makefile) and non-empty, it is used. 14 | # Otherwise, the default is set here. 15 | -------------------------------------------------------------------------------- /pkgs/binutils/deterministic.patch: -------------------------------------------------------------------------------- 1 | diff -ur orig/binutils-2.23.1/ld/ldlang.c binutils-2.23.1/ld/ldlang.c 2 | --- orig/ld/ldlang.c 3 | +++ new/ld/ldlang.c 4 | @@ -3095,6 +3095,8 @@ 5 | ldfile_output_machine)) 6 | einfo (_("%P%F:%s: can not set architecture: %E\n"), name); 7 | 8 | + link_info.output_bfd->flags |= BFD_DETERMINISTIC_OUTPUT; 9 | + 10 | link_info.hash = bfd_link_hash_table_create (link_info.output_bfd); 11 | if (link_info.hash == NULL) 12 | einfo (_("%P%F: can not create hash table: %E\n")); 13 | -------------------------------------------------------------------------------- /pkgs/binutils/libbfd.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv 2 | , binutils-unwrapped-all-targets 3 | }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "libbfd"; 7 | inherit (binutils-unwrapped-all-targets) version; 8 | 9 | dontUnpack = true; 10 | dontBuild = true; 11 | dontInstall = true; 12 | propagatedBuildInputs = [ 13 | binutils-unwrapped-all-targets.dev 14 | binutils-unwrapped-all-targets.lib 15 | ]; 16 | 17 | passthru = { 18 | inherit (binutils-unwrapped-all-targets) dev hasPluginAPI; 19 | }; 20 | 21 | meta = with lib; { 22 | description = "Library for manipulating containers of machine code"; 23 | longDescription = '' 24 | BFD is a library which provides a single interface to read and write 25 | object files, executables, archive files, and core files in any format. 26 | It is associated with GNU Binutils, and elsewhere often distributed with 27 | it. 28 | ''; 29 | homepage = "https://www.gnu.org/software/binutils/"; 30 | license = licenses.gpl3Plus; 31 | maintainers = with maintainers; [ ]; 32 | platforms = platforms.unix; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /pkgs/binutils/libopcodes.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv 2 | , binutils-unwrapped-all-targets 3 | }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "libopcodes"; 7 | inherit (binutils-unwrapped-all-targets) version; 8 | 9 | dontUnpack = true; 10 | dontBuild = true; 11 | dontInstall = true; 12 | propagatedBuildInputs = [ 13 | binutils-unwrapped-all-targets.dev 14 | binutils-unwrapped-all-targets.lib 15 | ]; 16 | 17 | passthru = { 18 | inherit (binutils-unwrapped-all-targets) dev hasPluginAPI; 19 | }; 20 | 21 | meta = with lib; { 22 | description = "Library from binutils for manipulating machine code"; 23 | homepage = "https://www.gnu.org/software/binutils/"; 24 | license = licenses.gpl3Plus; 25 | maintainers = with maintainers; [ ]; 26 | platforms = platforms.unix; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /pkgs/binutils/plugins-no-BINDIR.patch: -------------------------------------------------------------------------------- 1 | Avoid `lib -> out -> lib` reference. Normally `bfd-plugins` does not 2 | need to know binutils' BINDIR at all. It's an absolute path where 3 | libraries are stored. 4 | --- a/bfd/plugin.c 5 | +++ b/bfd/plugin.c 6 | @@ -493,7 +493,7 @@ build_plugin_list (bfd *abfd) 7 | when configuring binutils using --libdir. Search in the proper 8 | path first, then the old one for backwards compatibility. */ 9 | static const char *path[] 10 | - = { LIBDIR "/bfd-plugins", BINDIR "/../lib/bfd-plugins" }; 11 | + = { LIBDIR "/bfd-plugins", }; 12 | struct stat last_st; 13 | unsigned int i; 14 | 15 | @@ -508,9 +508,7 @@ build_plugin_list (bfd *abfd) 16 | last_st.st_ino = 0; 17 | for (i = 0; i < sizeof (path) / sizeof (path[0]); i++) 18 | { 19 | - char *plugin_dir = make_relative_prefix (plugin_program_name, 20 | - BINDIR, 21 | - path[i]); 22 | + char *plugin_dir = xstrdup (path[i]); 23 | if (plugin_dir) 24 | { 25 | struct stat st; 26 | -------------------------------------------------------------------------------- /pkgs/binutils/windres-locate-gcc.patch: -------------------------------------------------------------------------------- 1 | diff --git a/binutils/resrc.c b/binutils/resrc.c 2 | index a875c3a4..0411d047 100644 3 | --- a/binutils/resrc.c 4 | +++ b/binutils/resrc.c 5 | @@ -521,7 +521,13 @@ read_rc_file (const char *filename, const char *preprocessor, 6 | 7 | cpp_pipe = 0; 8 | 9 | - if (dash) 10 | + /* Nixpkgs specific : look first at the prefixed path 11 | + ( there should be no gcc in the binutils folder ) */ 12 | + if (slash && dash) { 13 | + cpp_pipe = look_for_default(cmd, slash + 1, dash - slash, preprocargs, filename); 14 | + } 15 | + 16 | + if (dash && ! cpp_pipe) 17 | { 18 | /* First, try looking for a prefixed gcc in the windres 19 | directory, with the same prefix as windres */ 20 | -------------------------------------------------------------------------------- /pkgs/bzip2/1_1.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv 2 | , fetchFromGitLab 3 | , meson 4 | , python3 5 | , ninja 6 | , testers 7 | }: 8 | 9 | stdenv.mkDerivation (finalAttrs: { 10 | pname = "bzip2-unstable"; 11 | version = "2020-08-11"; 12 | 13 | src = fetchFromGitLab { 14 | owner = "federicomenaquintero"; 15 | repo = "bzip2"; 16 | rev = "15255b553e7c095fb7a26d4dc5819a11352ebba1"; 17 | hash = "sha256-BAyz35D62LWi47B/gNcCSKpdaECHBGSpt21vtnk3fKs="; 18 | }; 19 | 20 | postPatch = '' 21 | patchShebangs install_links.py 22 | ''; 23 | 24 | nativeBuildInputs = [ 25 | meson 26 | python3 27 | ninja 28 | ]; 29 | 30 | outputs = [ "bin" "dev" "out" "man" ]; 31 | 32 | mesonFlags = [ 33 | "-Ddocs=disabled" 34 | ]; 35 | 36 | strictDeps = true; 37 | 38 | passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 39 | 40 | meta = with lib; { 41 | description = "High-quality data compression program"; 42 | license = licenses.bsdOriginal; 43 | pkgConfigModules = [ "bz2" ]; 44 | platforms = platforms.all; 45 | maintainers = [ ]; 46 | }; 47 | }) 48 | -------------------------------------------------------------------------------- /pkgs/coreutils/fix-test-failure-musl.patch: -------------------------------------------------------------------------------- 1 | From 1defda6356c29c7f731bddb9e9231f594e01d9c9 2 | (adjusted so it can be applied on coreutils to coreutils tarball) 3 | 4 | Reported by Adept's Lab via Pádraig Brady at 5 | . 6 | 7 | diff --git a/gnulib-tests/test-canonicalize.c b/gnulib-tests/test-canonicalize.c 8 | index 6763a525c9..5d19285c00 100644 9 | --- a/gnulib-tests/test-canonicalize.c 10 | +++ b/gnulib-tests/test-canonicalize.c 11 | @@ -394,9 +394,9 @@ main (void) 12 | ASSERT (stat ("/", &st1) == 0); 13 | ASSERT (stat ("//", &st2) == 0); 14 | bool same = psame_inode (&st1, &st2); 15 | -#if defined __MVS__ || defined MUSL_LIBC 16 | - /* On IBM z/OS and musl libc, "/" and "//" both canonicalize to 17 | - themselves, yet they both have st_dev == st_ino == 1. */ 18 | +#if defined __MVS__ 19 | + /* On IBM z/OS, "/" and "//" both canonicalize to themselves, yet they both 20 | + have st_dev == st_ino == 1. */ 21 | same = false; 22 | #endif 23 | if (same) 24 | -------------------------------------------------------------------------------- /pkgs/db/CVE-2017-10140-4.8-cwd-db_config.patch: -------------------------------------------------------------------------------- 1 | --- a/env/env_open.c.old 2017-06-26 10:32:11.011419981 +0200 2 | +++ b/env/env_open.c 2017-06-26 10:32:46.893721233 +0200 3 | @@ -473,7 +473,7 @@ 4 | env->db_mode = mode == 0 ? DB_MODE_660 : mode; 5 | 6 | /* Read the DB_CONFIG file. */ 7 | - if ((ret = __env_read_db_config(env)) != 0) 8 | + if (env->db_home != NULL && (ret = __env_read_db_config(env)) != 0) 9 | return (ret); 10 | 11 | /* 12 | -------------------------------------------------------------------------------- /pkgs/db/CVE-2017-10140-cwd-db_config.patch: -------------------------------------------------------------------------------- 1 | --- db-5.3.28/src/env/env_open.c.old 2017-06-26 10:32:11.011419981 +0200 2 | +++ db-5.3.28/src/env/env_open.c 2017-06-26 10:32:46.893721233 +0200 3 | @@ -473,7 +473,7 @@ 4 | env->db_mode = mode == 0 ? DB_MODE_660 : mode; 5 | 6 | /* Read the DB_CONFIG file. */ 7 | - if ((ret = __env_read_db_config(env)) != 0) 8 | + if (env->db_home != NULL && (ret = __env_read_db_config(env)) != 0) 9 | return (ret); 10 | 11 | /* 12 | -------------------------------------------------------------------------------- /pkgs/db/db-4.8.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, autoreconfHook, ... } @ args: 2 | 3 | import ./generic.nix (args // { 4 | version = "4.8.30"; 5 | sha256 = "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0"; 6 | extraPatches = [ 7 | ./clang-4.8.patch 8 | ./CVE-2017-10140-4.8-cwd-db_config.patch 9 | ./darwin-mutexes-4.8.patch 10 | ]; 11 | 12 | drvArgs.hardeningDisable = [ "format" ]; 13 | drvArgs.doCheck = false; 14 | }) 15 | -------------------------------------------------------------------------------- /pkgs/db/db-5.3.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, autoreconfHook, ... } @ args: 2 | 3 | import ./generic.nix (args // { 4 | version = "5.3.28"; 5 | sha256 = "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0"; 6 | extraPatches = [ 7 | ./clang-5.3.patch 8 | ./CVE-2017-10140-cwd-db_config.patch 9 | ./darwin-mutexes.patch 10 | ]; 11 | }) 12 | -------------------------------------------------------------------------------- /pkgs/db/db-6.0.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, autoreconfHook, ... } @ args: 2 | 3 | import ./generic.nix (args // { 4 | version = "6.0.30"; 5 | sha256 = "1lhglbvg65j5slrlv7qv4vi3cvd7kjywa07gq1abzschycf4p3k0"; 6 | license = lib.licenses.agpl3Only; 7 | extraPatches = [ 8 | ./clang-6.0.patch 9 | ./CVE-2017-10140-cwd-db_config.patch 10 | ./darwin-mutexes.patch 11 | ]; 12 | }) 13 | -------------------------------------------------------------------------------- /pkgs/db/db-6.2.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl, autoreconfHook, ... } @ args: 2 | 3 | import ./generic.nix (args // { 4 | version = "6.2.32"; 5 | sha256 = "1yx8wzhch5wwh016nh0kfxvknjkafv6ybkqh6nh7lxx50jqf5id9"; 6 | license = lib.licenses.agpl3Only; 7 | extraPatches = [ 8 | ./clang-6.0.patch 9 | ./CVE-2017-10140-cwd-db_config.patch 10 | ./darwin-mutexes.patch 11 | ]; 12 | }) 13 | -------------------------------------------------------------------------------- /pkgs/findutils/no-install-statedir.patch: -------------------------------------------------------------------------------- 1 | --- a/locate/Makefile.in 2 | +++ b/locate/Makefile.in 3 | @@ -2357,7 +2357,7 @@ updatedb: updatedb.sh Makefile 4 | chmod +x $@ 5 | 6 | install-data-hook: 7 | - $(top_srcdir)/build-aux/mkinstalldirs $(DESTDIR)$(localstatedir) 8 | + #$(top_srcdir)/build-aux/mkinstalldirs $(DESTDIR)$(localstatedir) 9 | 10 | dblocation.texi: 11 | echo '@set LOCATE_DB $(LOCATE_DB)' > $@.tmp 12 | -------------------------------------------------------------------------------- /pkgs/gawk/gawk-with-extensions.nix: -------------------------------------------------------------------------------- 1 | { runCommand, gawk, extensions, makeWrapper }: 2 | 3 | runCommand "gawk-with-extensions" { 4 | nativeBuildInputs = [ makeWrapper ]; 5 | buildInputs = [ gawk ] ++ extensions; 6 | } '' 7 | mkdir -p $out/bin 8 | for i in ${gawk}/bin/*; do 9 | name="$(basename "$i")" 10 | makeWrapper $i $out/bin/$name \ 11 | --prefix AWKLIBPATH : "${gawk}/lib/gawk:''${AWKLIBPATH:-}" 12 | done 13 | '' 14 | -------------------------------------------------------------------------------- /pkgs/gawk/setup-hook.sh: -------------------------------------------------------------------------------- 1 | local oldOpts="-u" 2 | shopt -qo nounset || oldOpts="+u" 3 | set +u 4 | . @gawk@/etc/profile.d/gawk.sh 5 | gawklibpath_append @out@/lib/gawk 6 | set "$oldOpts" 7 | -------------------------------------------------------------------------------- /pkgs/gcc/common/meta.nix: -------------------------------------------------------------------------------- 1 | { lib, version, }: 2 | 3 | let 4 | inherit (lib) 5 | licenses 6 | maintainers 7 | platforms 8 | teams 9 | versionOlder 10 | ; 11 | in 12 | { 13 | homepage = "https://gcc.gnu.org/"; 14 | license = licenses.gpl3Plus; # runtime support libraries are typically LGPLv3+ 15 | description = "GNU Compiler Collection, version ${version}"; 16 | longDescription = '' 17 | The GNU Compiler Collection includes compiler front ends for C, C++, 18 | Objective-C, Fortran, OpenMP for C/C++/Fortran, and Ada, as well as 19 | libraries for these languages (libstdc++, libgomp,...). 20 | 21 | GCC development is a part of the GNU Project, aiming to improve the 22 | compiler used in the GNU system including the GNU/Linux variant. 23 | ''; 24 | 25 | platforms = platforms.unix; 26 | maintainers = [ ]; 27 | 28 | } 29 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/11/libgcc-aarch64-darwin-detection.patch: -------------------------------------------------------------------------------- 1 | diff -u a/libgcc/config.host b/libgcc/config.host 2 | --- a/libgcc/config.host 2023-11-05 11:01:55.778638446 -0500 3 | +++ b/libgcc/config.host 2023-11-05 11:07:29.405103979 -0500 4 | @@ -227,7 +227,7 @@ 5 | tmake_file="$tmake_file t-slibgcc-darwin" 6 | # newer toolsets produce warnings when building for unsupported versions. 7 | case ${host} in 8 | - *-*-darwin1[89]* | *-*-darwin2* ) 9 | + *-*-darwin1[89]* | *-*-darwin2* | aarch64*-*-darwin*) 10 | tmake_file="t-darwin-min-8 $tmake_file" 11 | ;; 12 | *-*-darwin9* | *-*-darwin1[0-7]*) 13 | diff -ur a/libgcc/config/t-darwin-rpath b/libgcc/config/t-darwin-rpath 14 | --- a/libgcc/config/t-darwin-rpath 2023-11-05 11:34:18.691150009 -0500 15 | +++ b/libgcc/config/t-darwin-rpath 2023-11-05 11:50:36.968920904 -0500 16 | @@ -2,4 +2,4 @@ 17 | SHLIB_RPATH = @rpath 18 | 19 | # Which does not work for Darwin < 9 20 | -HOST_LIBGCC2_CFLAGS += -mmacosx-version-min=10.5 21 | +SHLIB_LOADER_PATH = -Wl,-rpath,@loader_path 22 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/13/no-sys-dirs-riscv.patch: -------------------------------------------------------------------------------- 1 | --- a/gcc/config/riscv/linux.h 2 | +++ b/gcc/config/riscv/linux.h 3 | @@ -69,9 +69,5 @@ 4 | 5 | #define TARGET_ASM_FILE_END file_end_indicate_exec_stack 6 | 7 | -#define STARTFILE_PREFIX_SPEC \ 8 | - "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 9 | - "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 10 | - "/lib/ " \ 11 | - "/usr/lib/ " 12 | +#define STARTFILE_PREFIX_SPEC "" 13 | 14 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/14/gnat-darwin-dylib-install-name-14.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in 2 | index 0666fc00b..0e2d53eb8 100644 3 | --- a/gcc/ada/gcc-interface/Makefile.in 4 | +++ b/gcc/ada/gcc-interface/Makefile.in 5 | @@ -793,14 +793,14 @@ gnatlib-shared-darwin: 6 | -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 7 | $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ 8 | $(SO_OPTS) \ 9 | - -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 10 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 11 | -nodefaultrpaths -Wl,-rpath,@loader_path/,-rpath,@loader_path/.. \ 12 | -Wl,-rpath,@loader_path/../../../../ $(MISCLIB) 13 | cd $(RTSDIR); $(GCC_FOR_ADA_RTS) -dynamiclib $(PICFLAG_FOR_TARGET) \ 14 | -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 15 | $(GNATRTL_TASKING_OBJS) \ 16 | $(SO_OPTS) \ 17 | - -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 18 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 19 | -nodefaultrpaths -Wl,-rpath,@loader_path/,-rpath,@loader_path/.. \ 20 | -Wl,-rpath,@loader_path/../../../../ \ 21 | $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) 22 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/14/libgcc-darwin-detection.patch: -------------------------------------------------------------------------------- 1 | diff -u a/libgcc/config.host b/libgcc/config.host 2 | --- a/libgcc/config.host 2023-11-05 11:01:55.778638446 -0500 3 | +++ b/libgcc/config.host 2023-11-05 11:07:29.405103979 -0500 4 | @@ -227,7 +227,7 @@ 5 | tmake_file="$tmake_file t-slibgcc-darwin" 6 | # newer toolsets produce warnings when building for unsupported versions. 7 | case ${host} in 8 | - *-*-darwin1[89]* | *-*-darwin2* ) 9 | + *-*-darwin1[89]* | *-*-darwin2* | *-*-darwin) 10 | tmake_file="t-darwin-min-8 $tmake_file" 11 | ;; 12 | *-*-darwin9* | *-*-darwin1[0-7]*) 13 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/4.9/darwin-clang-as.patch: -------------------------------------------------------------------------------- 1 | diff -ur a/libgcc/config/t-darwin b/libgcc/config/t-darwin 2 | --- a/libgcc/config/t-darwin 2012-07-14 09:50:59.000000000 -0400 3 | +++ b/libgcc/config/t-darwin 2023-11-05 21:26:11.696825584 -0500 4 | @@ -7,12 +7,6 @@ 5 | crttme.o: $(srcdir)/config/darwin-crt-tm.c 6 | $(crt_compile) $(DARWIN_EXTRA_CRT_BUILD_CFLAGS) -DEND -c $< 7 | 8 | -# -pipe because there's an assembler bug, 4077127, which causes 9 | -# it to not properly process the first # directive, causing temporary 10 | -# file names to appear in stabs, causing the bootstrap to fail. Using -pipe 11 | -# works around this by not having any temporary file names. 12 | -HOST_LIBGCC2_CFLAGS += -pipe 13 | - 14 | # Use unwind-dw2-fde-darwin 15 | LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/config/unwind-dw2-fde-darwin.c \ 16 | $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c 17 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/4.9/libsanitizer.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 2 | index aec950454..5bda9b3a3 100644 3 | --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 4 | +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 5 | @@ -156,18 +156,13 @@ namespace __sanitizer { 6 | #elif defined(__sparc__) 7 | # if defined(__arch64__) 8 | unsigned mode; 9 | - unsigned short __pad1; 10 | -# else 11 | - unsigned short __pad1; 12 | - unsigned short mode; 13 | unsigned short __pad2; 14 | # endif 15 | unsigned short __seq; 16 | unsigned long long __unused1; 17 | unsigned long long __unused2; 18 | #else 19 | - unsigned short mode; 20 | - unsigned short __pad1; 21 | + unsigned int mode; 22 | unsigned short __seq; 23 | unsigned short __pad2; 24 | #if defined(__x86_64__) && !defined(_LP64) 25 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/6/gnat-glibc234.patch: -------------------------------------------------------------------------------- 1 | Fix build with glibc 2.34. Adapted from: 2 | https://github.com/gcc-mirror/gcc/commit/331763de7d4850702a0f67298f36017c73cdb103 3 | --- a/gcc/ada/init.c 4 | +++ b/gcc/ada/init.c 5 | @@ -579,12 +579,8 @@ 6 | 7 | #ifndef __ia64__ 8 | #define HAVE_GNAT_ALTERNATE_STACK 1 9 | -/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. 10 | - It must be larger than MINSIGSTKSZ and hopefully near 2 * SIGSTKSZ. */ 11 | -# if 16 * 1024 < MINSIGSTKSZ 12 | -# error "__gnat_alternate_stack too small" 13 | -# endif 14 | -char __gnat_alternate_stack[16 * 1024]; 15 | +/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */ 16 | +char __gnat_alternate_stack[32 * 1024]; 17 | #endif 18 | 19 | #ifdef __XENO__ 20 | --- a/gcc/ada/s-osinte-linux.ads 21 | +++ b/gcc/ada/s-osinte-linux.ads 22 | @@ -328,7 +328,7 @@ 23 | oss : access stack_t) return int; 24 | pragma Import (C, sigaltstack, "sigaltstack"); 25 | 26 | - Alternate_Stack_Size : constant := 16 * 1024; 27 | + Alternate_Stack_Size : constant := 32 * 1024; 28 | -- This must be in keeping with init.c:__gnat_alternate_stack 29 | 30 | Alternate_Stack : aliased char_array (1 .. Alternate_Stack_Size); 31 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/6/gogcc-workaround-glibc-2.36.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libgo/mksysinfo.sh b/libgo/mksysinfo.sh 2 | index dd456e907..24e607c7b 100755 3 | --- a/libgo/mksysinfo.sh 4 | +++ b/libgo/mksysinfo.sh 5 | @@ -148,9 +148,6 @@ cat > sysinfo.c < 8 | #endif 9 | -#if defined(HAVE_LINUX_FS_H) 10 | -#include 11 | -#endif 12 | #if defined(HAVE_LINUX_REBOOT_H) 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/6/libstdc++-disable-flat_namespace.patch: -------------------------------------------------------------------------------- 1 | Backported from GCC 7. 2 | 3 | diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host 4 | index 304a7f5aff6..d1a189d93d0 100644 5 | --- a/libstdc++-v3/configure.host 6 | +++ b/libstdc++-v3/configure.host 7 | @@ -234,7 +234,7 @@ case "${host_os}" in 8 | os_include_dir="os/newlib" 9 | OPT_LDFLAGS="${OPT_LDFLAGS} \$(lt_host_flags)" 10 | ;; 11 | - darwin | darwin[1-7] | darwin[1-7].*) 12 | + darwin[1-7] | darwin[1-7].*) 13 | # On Darwin, performance is improved if libstdc++ is single-module. 14 | # Up to at least 10.3.7, -flat_namespace is required for proper 15 | # treatment of coalesced symbols. 16 | @@ -252,6 +252,10 @@ case "${host_os}" in 17 | esac 18 | os_include_dir="os/bsd/darwin" 19 | ;; 20 | + darwin*) 21 | + # Post Darwin8, defaults should be sufficient. 22 | + os_include_dir="os/bsd/darwin" 23 | + ;; 24 | *djgpp*) # leading * picks up "msdosdjgpp" 25 | os_include_dir="os/djgpp" 26 | error_constants_dir="os/djgpp" 27 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/7/riscv-pthread-reentrant.patch: -------------------------------------------------------------------------------- 1 | Index: gcc/config/riscv/linux.h 2 | =================================================================== 3 | --- a/gcc/config/riscv/linux.h (revision 257620) 4 | +++ b/gcc/config/riscv/linux.h (revision 257621) 5 | @@ -47,6 +47,8 @@ 6 | 7 | #define ICACHE_FLUSH_FUNC "__riscv_flush_icache" 8 | 9 | +#define CPP_SPEC "%{pthread:-D_REENTRANT}" 10 | + 11 | #define LINK_SPEC "\ 12 | -melf" XLEN_SPEC "lriscv \ 13 | %{shared} \ 14 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/8/avr-gcc-8-darwin.patch: -------------------------------------------------------------------------------- 1 | From https://gist.githubusercontent.com/DavidEGrayson/88bceb3f4e62f45725ecbb9248366300/raw/c1f515475aff1e1e3985569d9b715edb0f317648/gcc-11-arm-darwin.patch 2 | 3 | diff -ur a/gcc/config/host-darwin.c b/gcc/config/host-darwin.c 4 | --- a/gcc/config/host-darwin.c 2021-04-27 03:00:13.000000000 -0700 5 | +++ b/gcc/config/host-darwin.c 2021-06-11 14:49:13.754000000 -0700 6 | @@ -22,6 +22,10 @@ 7 | #include "coretypes.h" 8 | #include "diagnostic-core.h" 9 | #include "config/host-darwin.h" 10 | +#include "hosthooks.h" 11 | +#include "hosthooks-def.h" 12 | + 13 | +const struct host_hooks host_hooks = HOST_HOOKS_INITIALIZER; 14 | 15 | /* Yes, this is really supposed to work. */ 16 | /* This allows for a pagesize of 16384, which we have on Darwin20, but should -------------------------------------------------------------------------------- /pkgs/gcc/patches/gcc-12-gfortran-driving.patch: -------------------------------------------------------------------------------- 1 | This patch fixes interaction with Libtool. 2 | See , for details. 3 | 4 | --- a/gcc/fortran/gfortranspec.cc 5 | +++ b/gcc/fortran/gfortranspec.cc 6 | @@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n")); 7 | { 8 | fprintf (stderr, _("Driving:")); 9 | for (i = 0; i < g77_newargc; i++) 10 | + { 11 | + if (g77_new_decoded_options[i].opt_index == OPT_l) 12 | + /* Make sure no white space is inserted after `-l'. */ 13 | + fprintf (stderr, " -l%s", 14 | + g77_new_decoded_options[i].canonical_option[1]); 15 | + else 16 | fprintf (stderr, " %s", 17 | g77_new_decoded_options[i].orig_option_with_args_text); 18 | + } 19 | fprintf (stderr, "\n"); 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/gcc-12-no-sys-dirs.patch: -------------------------------------------------------------------------------- 1 | --- a/gcc/cppdefault.cc 2013-01-10 21:38:27.000000000 +0100 2 | +++ b/gcc/cppdefault.cc 2014-08-18 16:20:32.893944536 +0200 3 | @@ -35,6 +35,8 @@ 4 | # undef CROSS_INCLUDE_DIR 5 | #endif 6 | 7 | +#undef LOCAL_INCLUDE_DIR 8 | + 9 | const struct default_include cpp_include_defaults[] 10 | #ifdef INCLUDE_DEFAULTS 11 | = INCLUDE_DEFAULTS; 12 | --- a/gcc/gcc.cc 2014-03-23 12:30:57.000000000 +0100 13 | +++ b/gcc/gcc.cc 2014-08-18 13:19:32.689201690 +0200 14 | @@ -1162,10 +1162,10 @@ 15 | /* Default prefixes to attach to command names. */ 16 | 17 | #ifndef STANDARD_STARTFILE_PREFIX_1 18 | -#define STANDARD_STARTFILE_PREFIX_1 "/lib/" 19 | +#define STANDARD_STARTFILE_PREFIX_1 "" 20 | #endif 21 | #ifndef STANDARD_STARTFILE_PREFIX_2 22 | -#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" 23 | +#define STANDARD_STARTFILE_PREFIX_2 "" 24 | #endif 25 | 26 | #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ 27 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/gfortran-darwin-NXConstStr.patch: -------------------------------------------------------------------------------- 1 | From 82f81877458ea372176eabb5de36329431dce99b Mon Sep 17 00:00:00 2001 2 | From: Iain Sandoe 3 | Date: Sat, 21 Dec 2013 00:30:18 +0000 4 | Subject: [PATCH] don't try to mark local symbols as no-dead-strip 5 | 6 | --- 7 | gcc/config/darwin.c | 5 +++++ 8 | 1 file changed, 5 insertions(+) 9 | 10 | diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c 11 | index 40804b8..0080299 100644 12 | --- a/gcc/config/darwin.c 13 | +++ b/gcc/config/darwin.c 14 | @@ -1259,6 +1259,11 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED) 15 | void 16 | darwin_mark_decl_preserved (const char *name) 17 | { 18 | + /* Actually we shouldn't mark any local symbol this way, but for now 19 | + this only happens with ObjC meta-data. */ 20 | + if (darwin_label_is_anonymous_local_objc_name (name)) 21 | + return; 22 | + 23 | fprintf (asm_out_file, "\t.no_dead_strip "); 24 | assemble_name (asm_out_file, name); 25 | fputc ('\n', asm_out_file); 26 | -- 27 | 2.2.1 28 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/gfortran-driving.patch: -------------------------------------------------------------------------------- 1 | This patch fixes interaction with Libtool. 2 | See , for details. 3 | 4 | --- a/gcc/fortran/gfortranspec.c 5 | +++ b/gcc/fortran/gfortranspec.c 6 | @@ -461,8 +461,15 @@ For more information about these matters, see the file named COPYING\n\n")); 7 | { 8 | fprintf (stderr, _("Driving:")); 9 | for (i = 0; i < g77_newargc; i++) 10 | + { 11 | + if (g77_new_decoded_options[i].opt_index == OPT_l) 12 | + /* Make sure no white space is inserted after `-l'. */ 13 | + fprintf (stderr, " -l%s", 14 | + g77_new_decoded_options[i].canonical_option[1]); 15 | + else 16 | fprintf (stderr, " %s", 17 | g77_new_decoded_options[i].orig_option_with_args_text); 18 | + } 19 | fprintf (stderr, "\n"); 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/gnat-darwin-dylib-install-name-13.patch: -------------------------------------------------------------------------------- 1 | --- a/gcc/ada/gcc-interface/Makefile.in 2 | +++ b/gcc/ada/gcc-interface/Makefile.in 3 | @@ -788,13 +788,13 @@ gnatlib-shared-darwin: 4 | -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 5 | $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ 6 | $(SO_OPTS) \ 7 | - -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 8 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 9 | $(MISCLIB) 10 | cd $(RTSDIR); $(GCC_FOR_ADA_RTS) -dynamiclib $(PICFLAG_FOR_TARGET) \ 11 | -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 12 | $(GNATRTL_TASKING_OBJS) \ 13 | $(SO_OPTS) \ 14 | - -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 15 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 16 | $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) 17 | cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 18 | libgnat$(soext) 19 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/gnat-darwin-dylib-install-name.patch: -------------------------------------------------------------------------------- 1 | --- a/gcc/ada/gcc-interface/Makefile.in 2022-08-19 18:09:52.000000000 +1000 2 | +++ b/gcc/ada/gcc-interface/Makefile.in 2023-01-11 01:54:06.000000000 +1100 3 | @@ -795,14 +795,14 @@ 4 | -o libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 5 | $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) \ 6 | $(SO_OPTS) \ 7 | - -Wl,-install_name,@rpath/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 8 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 9 | $(MISCLIB) 10 | cd $(RTSDIR); `echo "$(GCC_FOR_TARGET)" \ 11 | | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'` -dynamiclib $(PICFLAG_FOR_TARGET) \ 12 | -o libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 13 | $(GNATRTL_TASKING_OBJS) \ 14 | $(SO_OPTS) \ 15 | - -Wl,-install_name,@rpath/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 16 | + -Wl,-install_name,$(ADA_RTL_DSO_DIR)/libgnarl$(hyphen)$(LIBRARY_VERSION)$(soext) \ 17 | $(THREADSLIB) -Wl,libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) 18 | cd $(RTSDIR); $(LN_S) libgnat$(hyphen)$(LIBRARY_VERSION)$(soext) \ 19 | libgnat$(soext) 20 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/libgomp-dont-force-initial-exec.patch: -------------------------------------------------------------------------------- 1 | From 01c433f4788441c0963005b9d3fad5b2865e6651 Mon Sep 17 00:00:00 2001 2 | From: Will Dietz 3 | Date: Mon, 24 Sep 2018 19:57:50 -0500 4 | Subject: [PATCH] libgomp/configure.tgt: don't force initial-exec tls-model 5 | 6 | --- 7 | libgomp/configure.tgt | 17 ----------------- 8 | 1 file changed, 17 deletions(-) 9 | 10 | diff --git a/libgomp/configure.tgt b/libgomp/configure.tgt 11 | index 74d95a570c7..b608c55f0c1 100644 12 | --- a/libgomp/configure.tgt 13 | +++ b/libgomp/configure.tgt 14 | @@ -10,23 +10,6 @@ 15 | # XCFLAGS Add extra compile flags to use. 16 | # XLDFLAGS Add extra link flags to use. 17 | 18 | -# Optimize TLS usage by avoiding the overhead of dynamic allocation. 19 | -if test $gcc_cv_have_tls = yes ; then 20 | - case "${target}" in 21 | - 22 | - *-*-k*bsd*-gnu*) 23 | - ;; 24 | - 25 | - *-*-linux* | *-*-gnu*) 26 | - XCFLAGS="${XCFLAGS} -ftls-model=initial-exec" 27 | - ;; 28 | - 29 | - *-*-rtems*) 30 | - XCFLAGS="${XCFLAGS} -ftls-model=local-exec" 31 | - ;; 32 | - esac 33 | -fi 34 | - 35 | # Since we require POSIX threads, assume a POSIX system by default. 36 | config_path="posix" 37 | 38 | -- 39 | 2.19.0 40 | 41 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/no-sys-dirs-riscv-gcc9.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gcc/config/riscv/riscv.h b/gcc/config/riscv/riscv.h 2 | index 701f5ea1544..8de333caf54 100644 3 | --- a/gcc/config/riscv/riscv.h 4 | +++ b/gcc/config/riscv/riscv.h 5 | @@ -886,11 +886,7 @@ extern unsigned riscv_stack_boundary; 6 | "%{mabi=lp64f:lp64f}" \ 7 | "%{mabi=lp64d:lp64d}" \ 8 | 9 | -#define STARTFILE_PREFIX_SPEC \ 10 | - "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 11 | - "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 12 | - "/lib/ " \ 13 | - "/usr/lib/ " 14 | +#define STARTFILE_PREFIX_SPEC "" 15 | 16 | /* ISA constants needed for code generation. */ 17 | #define OPCODE_LW 0x2003 18 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/no-sys-dirs-riscv.patch: -------------------------------------------------------------------------------- 1 | --- a/gcc/config/riscv/linux.h 2 | +++ b/gcc/config/riscv/linux.h 3 | @@ -69,8 +69,4 @@ 4 | 5 | #define TARGET_ASM_FILE_END file_end_indicate_exec_stack 6 | 7 | -#define STARTFILE_PREFIX_SPEC \ 8 | - "/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 9 | - "/usr/lib" XLEN_SPEC "/" ABI_SPEC "/ " \ 10 | - "/lib/ " \ 11 | - "/usr/lib/ " 12 | +#define STARTFILE_PREFIX_SPEC "" 13 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/no-sys-dirs.patch: -------------------------------------------------------------------------------- 1 | diff -ru -x '*~' gcc-4.8.3-orig/gcc/cppdefault.c gcc-4.8.3/gcc/cppdefault.c 2 | --- gcc-4.8.3-orig/gcc/cppdefault.c 2013-01-10 21:38:27.000000000 +0100 3 | +++ gcc-4.8.3/gcc/cppdefault.c 2014-08-18 16:20:32.893944536 +0200 4 | @@ -35,6 +35,8 @@ 5 | # undef CROSS_INCLUDE_DIR 6 | #endif 7 | 8 | +#undef LOCAL_INCLUDE_DIR 9 | + 10 | const struct default_include cpp_include_defaults[] 11 | #ifdef INCLUDE_DEFAULTS 12 | = INCLUDE_DEFAULTS; 13 | diff -ru -x '*~' gcc-4.8.3-orig/gcc/gcc.c gcc-4.8.3/gcc/gcc.c 14 | --- gcc-4.8.3-orig/gcc/gcc.c 2014-03-23 12:30:57.000000000 +0100 15 | +++ gcc-4.8.3/gcc/gcc.c 2014-08-18 13:19:32.689201690 +0200 16 | @@ -1162,10 +1162,10 @@ 17 | /* Default prefixes to attach to command names. */ 18 | 19 | #ifndef STANDARD_STARTFILE_PREFIX_1 20 | -#define STANDARD_STARTFILE_PREFIX_1 "/lib/" 21 | +#define STANDARD_STARTFILE_PREFIX_1 "" 22 | #endif 23 | #ifndef STANDARD_STARTFILE_PREFIX_2 24 | -#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" 25 | +#define STANDARD_STARTFILE_PREFIX_2 "" 26 | #endif 27 | 28 | #ifdef CROSS_DIRECTORY_STRUCTURE /* Don't use these prefixes for a cross compiler. */ 29 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/ppc-musl.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h 2 | index cbee89140dd..e1f26b0a096 100644 3 | --- a/gcc/config/rs6000/sysv4.h 4 | +++ b/gcc/config/rs6000/sysv4.h 5 | @@ -996,13 +996,7 @@ ncrtn.o%s" 6 | { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, \ 7 | GPLUSPLUS_INCLUDE_DIR_ADD_SYSROOT, 0 }, 8 | 9 | -#ifdef LOCAL_INCLUDE_DIR 10 | -#define INCLUDE_DEFAULTS_MUSL_LOCAL \ 11 | - { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 2 }, \ 12 | - { LOCAL_INCLUDE_DIR, 0, 0, 1, 1, 0 }, 13 | -#else 14 | #define INCLUDE_DEFAULTS_MUSL_LOCAL 15 | -#endif 16 | 17 | #ifdef PREFIX_INCLUDE_DIR 18 | #define INCLUDE_DEFAULTS_MUSL_PREFIX \ 19 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/res_state-not-declared.patch: -------------------------------------------------------------------------------- 1 | diff --git a/libsanitizer/tsan/tsan_platform_linux.cc b/libsanitizer/tsan/tsan_platform_linux.cc 2 | index fe69430..49f5270 100644 3 | --- a/libsanitizer/tsan/tsan_platform_linux.cc 4 | +++ b/libsanitizer/tsan/tsan_platform_linux.cc 5 | @@ -351,7 +351,7 @@ bool IsGlobalVar(uptr addr) { 6 | // closes within glibc. The code is a pure hack. 7 | int ExtractResolvFDs(void *state, int *fds, int nfd) { 8 | int cnt = 0; 9 | - __res_state *statp = (__res_state*)state; 10 | + struct __res_state *statp = (struct __res_state*)state; 11 | for (int i = 0; i < MAXNS && cnt < nfd; i++) { 12 | if (statp->_u._ext.nsaddrs[i] && statp->_u._ext.nssocks[i] != -1) 13 | fds[cnt++] = statp->_u._ext.nssocks[i]; 14 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/sigsegv-not-declared.patch: -------------------------------------------------------------------------------- 1 | error: 'SIGSEGV' was not declared in this scope 2 | diff --git a/libsanitizer/asan/asan_linux.cc b/libsanitizer/asan/asan_linux.cc 3 | index 0692eb1..472f734 100644 4 | --- a/libsanitizer/asan/asan_linux.cc 5 | +++ b/libsanitizer/asan/asan_linux.cc 6 | @@ -26,6 +26,7 @@ 7 | #include 8 | #include 9 | #include 10 | +#include 11 | #include 12 | #include 13 | #include 14 | -------------------------------------------------------------------------------- /pkgs/gcc/patches/update-mcfgthread-patches.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env nix-shell 2 | #! nix-shell -i bash -p curl 3 | 4 | # We use this script to download local copies instead of using 5 | # fetchpatch because lmhouse/MINGW-packages-dev is constantly rebased 6 | # against msys2/MINGW-packages-dev and won't have stable commit hashes. 7 | 8 | name=Added-mcf-thread-model-support-from-mcfgthread.patch 9 | source=https://raw.githubusercontent.com/lhmouse/MINGW-packages-dev/master/mingw-w64-gcc-git 10 | dest=$(dirname "$0") 11 | 12 | for majorVersion in 6 7 8 9 10; do 13 | curl "$source/9000-gcc-$majorVersion-branch-$name" \ 14 | > "$dest/$majorVersion/$name" 15 | done 16 | -------------------------------------------------------------------------------- /pkgs/gettext/absolute-paths.diff: -------------------------------------------------------------------------------- 1 | diff --git a/gettext-runtime/src/gettext.sh.in b/gettext-runtime/src/gettext.sh.in 2 | index 1dfa3bb..d6ef8a8 100644 3 | --- a/gettext-runtime/src/gettext.sh.in 4 | +++ b/gettext-runtime/src/gettext.sh.in 5 | @@ -86,14 +86,14 @@ fi 6 | # looks up the translation of MSGID and substitutes shell variables in the 7 | # result. 8 | eval_gettext () { 9 | - gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1") 10 | + @out@/bin/gettext "$1" | (export PATH `@out@/bin/envsubst --variables "$1"`; @out@/bin/envsubst "$1") 11 | } 12 | 13 | # eval_ngettext MSGID MSGID-PLURAL COUNT 14 | # looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes 15 | # shell variables in the result. 16 | eval_ngettext () { 17 | - ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2") 18 | + @out@/bin/ngettext "$1" "$2" "$3" | (export PATH `@out@/bin/envsubst --variables "$1 $2"`; @out@/bin/envsubst "$1 $2") 19 | } 20 | 21 | # Note: This use of envsubst is much safer than using the shell built-in 'eval' 22 | -------------------------------------------------------------------------------- /pkgs/gettext/gettext-setup-hook.sh: -------------------------------------------------------------------------------- 1 | gettextDataDirsHook() { 2 | # See pkgs/build-support/setup-hooks/role.bash 3 | getHostRoleEnvHook 4 | if [ -d "$1/share/gettext" ]; then 5 | addToSearchPath "GETTEXTDATADIRS${role_post}" "$1/share/gettext" 6 | fi 7 | } 8 | 9 | addEnvHooks "$hostOffset" gettextDataDirsHook 10 | 11 | # libintl must be listed in load flags on non-Glibc 12 | # it doesn't hurt to have it in Glibc either though 13 | if [ -n "@gettextNeedsLdflags@" -a -z "${dontAddExtraLibs-}" ]; then 14 | # See pkgs/build-support/setup-hooks/role.bash 15 | getHostRole 16 | export NIX_LDFLAGS${role_post}+=" -lintl" 17 | fi 18 | -------------------------------------------------------------------------------- /pkgs/glibc/dont-use-system-ld-so-preload.patch: -------------------------------------------------------------------------------- 1 | diff -ru glibc-2.20-orig/elf/rtld.c glibc-2.20/elf/rtld.c 2 | --- glibc-2.20-orig/elf/rtld.c 2014-09-07 10:09:09.000000000 +0200 3 | +++ glibc-2.20/elf/rtld.c 2014-10-27 11:32:25.203043157 +0100 4 | @@ -1513,7 +1513,7 @@ 5 | open(). So we do this first. If it succeeds we do almost twice 6 | the work but this does not matter, since it is not for production 7 | use. */ 8 | - static const char preload_file[] = "/etc/ld.so.preload"; 9 | + static const char preload_file[] = "/etc/ld-nix.so.preload"; 10 | if (__glibc_unlikely (__access (preload_file, R_OK) == 0)) 11 | { 12 | /* Read the contents of the file. */ 13 | -------------------------------------------------------------------------------- /pkgs/glibc/fix-rpc-types-musl-conflicts.patch: -------------------------------------------------------------------------------- 1 | @@ -, +, @@ 2 | --- 3 | sunrpc/rpc/types.h | 22 ++++++---------------- 4 | 1 file changed, 6 insertions(+), 16 deletions(-) 5 | --- a/sunrpc/rpc/types.h 6 | +++ a/sunrpc/rpc/types.h 7 | @@ -69,24 +69,14 @@ typedef unsigned long rpcport_t; 8 | #include 9 | #endif 10 | 11 | -#if defined __APPLE_CC__ || defined __FreeBSD__ 12 | -# define __u_char_defined 13 | -# define __daddr_t_defined 14 | -#endif 15 | - 16 | -#ifndef __u_char_defined 17 | -typedef __u_char u_char; 18 | -typedef __u_short u_short; 19 | -typedef __u_int u_int; 20 | -typedef __u_long u_long; 21 | -typedef __quad_t quad_t; 22 | -typedef __u_quad_t u_quad_t; 23 | -typedef __fsid_t fsid_t; 24 | +/* IMPORTANT NOTE: This has been modified to build against the musl C 25 | + * library and it probably now ONLY builds with the musl C library. 26 | + * 27 | + * See: https://sourceware.org/bugzilla/show_bug.cgi?id=21604 28 | + */ 29 | # define __u_char_defined 30 | -#endif 31 | #ifndef __daddr_t_defined 32 | -typedef __daddr_t daddr_t; 33 | -typedef __caddr_t caddr_t; 34 | +typedef int daddr_t; 35 | # define __daddr_t_defined 36 | #endif 37 | 38 | -- 39 | -------------------------------------------------------------------------------- /pkgs/glibc/fix_path_attribute_in_getconf.patch: -------------------------------------------------------------------------------- 1 | diff -ubr glibc-2.17-orig/sysdeps/unix/confstr.h glibc-2.17/sysdeps/unix/confstr.h 2 | --- glibc-2.17-orig/sysdeps/unix/confstr.h 2013-06-03 22:01:44.829726968 +0200 3 | +++ glibc-2.17/sysdeps/unix/confstr.h 2013-06-03 22:04:39.469376740 +0200 4 | @@ -1 +1 @@ 5 | -#define CS_PATH "/bin:/usr/bin" 6 | +#define CS_PATH "/run/current-system/sw/bin:/bin:/usr/bin" 7 | -------------------------------------------------------------------------------- /pkgs/glibc/info.nix: -------------------------------------------------------------------------------- 1 | { callPackage, texinfo, perl }: 2 | 3 | callPackage ./common.nix {} { 4 | pname = "glibc-info"; 5 | 6 | outputs = [ "out" ]; 7 | 8 | configureFlags = [ "--enable-add-ons" ]; 9 | 10 | extraNativeBuildInputs = [ texinfo perl ]; 11 | 12 | makeFlags = [ "info" ]; 13 | 14 | # I don't know why the info is not generated in 'build' 15 | # Somehow building the info still does not work, because the final 16 | # libc.info hasn't a Top node. 17 | installPhase = '' 18 | mkdir -p "$out/share/info" 19 | cp -v "manual/"*.info* "$out/share/info" 20 | ''; 21 | 22 | meta.description = "GNU Info manual of the GNU C Library"; 23 | } 24 | -------------------------------------------------------------------------------- /pkgs/glibc/locales-builder.sh: -------------------------------------------------------------------------------- 1 | if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi 2 | # Glibc cannot have itself in its RPATH. 3 | export NIX_NO_SELF_RPATH=1 4 | 5 | source $stdenv/setup 6 | 7 | postConfigure() { 8 | # Hack: get rid of the `-static' flag set by the bootstrap stdenv. 9 | # This has to be done *after* `configure' because it builds some 10 | # test binaries. 11 | export NIX_CFLAGS_LINK= 12 | export NIX_LDFLAGS_BEFORE= 13 | 14 | export NIX_DONT_SET_RPATH=1 15 | unset CFLAGS 16 | } 17 | 18 | genericBuild 19 | -------------------------------------------------------------------------------- /pkgs/glibc/multi.nix: -------------------------------------------------------------------------------- 1 | { lib 2 | , runCommand, glibc, glibc32 3 | }: 4 | 5 | let 6 | nameVersion = builtins.parseDrvName glibc.name; 7 | glibc64 = glibc; 8 | in 9 | runCommand "${nameVersion.name}-multi-${nameVersion.version}" 10 | # out as the first output is an exception exclusive to glibc 11 | { 12 | outputs = [ "out" "bin" "dev" ]; # TODO: no static version here (yet) 13 | passthru = { 14 | libgcc = lib.lists.filter (x: x!=null) [ 15 | (glibc64.libgcc or null) 16 | (glibc32.libgcc or null) 17 | ]; 18 | }; 19 | } 20 | '' 21 | mkdir -p "$out/lib" 22 | ln -s '${glibc64.out}'/lib/* "$out/lib" 23 | ln -s '${glibc32.out}/lib' "$out/lib/32" 24 | ln -s lib "$out/lib64" 25 | 26 | # fixing ldd RLTDLIST 27 | mkdir -p "$bin/bin" 28 | cp -s '${glibc64.bin}'/bin/* "$bin/bin/" 29 | rm "$bin/bin/ldd" 30 | sed -e "s|^RTLDLIST=.*$|RTLDLIST=\"$out/lib/ld-linux-x86-64.so.2 $out/lib/32/ld-linux.so.2\"|g" \ 31 | '${glibc64.bin}/bin/ldd' > "$bin/bin/ldd" 32 | chmod +x "$bin/bin/ldd" 33 | 34 | mkdir "$dev" 35 | cp -rs '${glibc32.dev}'/include "$dev/" 36 | chmod +w -R "$dev" 37 | cp -rsf '${glibc64.dev}'/include "$dev/" 38 | '' 39 | -------------------------------------------------------------------------------- /pkgs/glibc/reenable_DT_HASH.patch: -------------------------------------------------------------------------------- 1 | From 31915e55f9c34f6137ab1c5ac002375a2d5d4589 Mon Sep 17 00:00:00 2001 2 | From: Frederik Schwan 3 | Date: Fri, 4 Aug 2023 15:19:57 +0200 4 | Subject: [PATCH] force --hash-style=both to keep compatibility with old niche 5 | software 6 | 7 | --- 8 | Makeconfig | 4 ++++ 9 | 1 file changed, 4 insertions(+) 10 | 11 | diff --git a/Makeconfig b/Makeconfig 12 | index 77d7fd14df..2ae67c4beb 100644 13 | --- a/Makeconfig 14 | +++ b/Makeconfig 15 | @@ -378,6 +378,10 @@ relro-LDFLAGS = -Wl,-z,relro 16 | LDFLAGS.so += $(relro-LDFLAGS) 17 | LDFLAGS-rtld += $(relro-LDFLAGS) 18 | 19 | +hashstyle-LDFLAGS = -Wl,--hash-style=both 20 | +LDFLAGS.so += $(hashstyle-LDFLAGS) 21 | +LDFLAGS-rtld += $(hashstyle-LDFLAGS) 22 | + 23 | # Linker options to enable and disable DT_RELR. 24 | ifeq ($(have-dt-relr),yes) 25 | dt-relr-ldflag = -Wl,-z,pack-relative-relocs 26 | -- 27 | 2.41.0 28 | 29 | -------------------------------------------------------------------------------- /pkgs/gmp/5.1.3-CVE-2021-43618.patch: -------------------------------------------------------------------------------- 1 | Based on https://gmplib.org/repo/gmp-6.2/raw-rev/561a9c25298e, 2 | adapted for 5.x by ris 3 | 4 | diff -r e1fd9db13b47 -r 561a9c25298e mpz/inp_raw.c 5 | --- a/mpz/inp_raw.c Tue Dec 22 23:49:51 2020 +0100 6 | +++ b/mpz/inp_raw.c Thu Oct 21 19:06:49 2021 +0200 7 | @@ -81,8 +81,11 @@ 8 | 9 | abs_csize = ABS (csize); 10 | 11 | + if (UNLIKELY (abs_csize > ~(mp_bitcnt_t) 0 / 8)) 12 | + return 0; /* Bit size overflows */ 13 | + 14 | /* round up to a multiple of limbs */ 15 | - abs_xsize = (abs_csize*8 + GMP_NUMB_BITS-1) / GMP_NUMB_BITS; 16 | + abs_xsize = ((mp_bitcnt_t)abs_csize*8 + GMP_NUMB_BITS-1) / GMP_NUMB_BITS; 17 | 18 | if (abs_xsize != 0) 19 | { 20 | 21 | -------------------------------------------------------------------------------- /pkgs/gmp/need-size-t.patch: -------------------------------------------------------------------------------- 1 | diff --git a/gmp-h.in b/gmp-h.in 2 | index 7deb67a..240d663 100644 3 | --- a/gmp-h.in 4 | +++ b/gmp-h.in 5 | @@ -46,13 +46,11 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ 6 | #ifndef __GNU_MP__ 7 | #define __GNU_MP__ 5 8 | 9 | -#define __need_size_t /* tell gcc stddef.h we only want size_t */ 10 | #if defined (__cplusplus) 11 | #include /* for size_t */ 12 | #else 13 | #include /* for size_t */ 14 | #endif 15 | -#undef __need_size_t 16 | 17 | /* Instantiated by configure. */ 18 | #if ! defined (__GMP_WITHIN_CONFIGURE) 19 | -------------------------------------------------------------------------------- /pkgs/gnum4/loong-fix-build.patch: -------------------------------------------------------------------------------- 1 | [xen0n: this is https://github.com/sunhaiyong1978/CLFS-for-LoongArch/blob/1.0/patches/stack-direction-add-loongarch.patch with line number tweak, and change to generated file added as well.] 2 | From: Sun Haiyong 3 | Date: Tue, 31 Aug 2021 11:11:52 +0800 4 | Subject: [PATCH] stack-direction: Add support for loongarch CPU 5 | 6 | * m4/stack-direction.m4 (SV_STACK_DIRECTION): When the CPU is loongarch, 7 | set "sv_cv_stack_direction" to "-1" . 8 | --- a/m4/stack-direction.m4 9 | +++ b/m4/stack-direction.m4 10 | @@ -31,6 +31,7 @@ AC_DEFUN([SV_STACK_DIRECTION], 11 | i?86 | x86_64 | \ 12 | i860 | \ 13 | ia64 | \ 14 | + loongarch* | \ 15 | m32r | \ 16 | m68* | \ 17 | m88k | \ 18 | --- a/configure 19 | +++ b/configure 20 | @@ -46399,6 +46399,7 @@ else $as_nop 21 | i?86 | x86_64 | \ 22 | i860 | \ 23 | ia64 | \ 24 | + loongarch* | \ 25 | m32r | \ 26 | m68* | \ 27 | m88k | \ 28 | -- 29 | 2.17.2 30 | 31 | -------------------------------------------------------------------------------- /pkgs/gnumake/0001-No-impure-bin-sh.patch: -------------------------------------------------------------------------------- 1 | From e00a5257a6ca5fedbf68b09eee7df3502971a057 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= 3 | Date: Sat, 24 Apr 2021 10:11:40 +0200 4 | Subject: [PATCH 1/2] No impure bin sh 5 | 6 | default_shell is used to populuate default shell used to execute jobs. 7 | Unless SHELL is set to a different value this would be /bin/sh. 8 | Our stdenv provides sh in form of bash anyway. Having this value not 9 | hard-coded has some advantages: 10 | 11 | - It would ensure that on all systems it uses sh from its PATH rather 12 | than /bin/sh, which helps as different systems might have different 13 | shells there (bash vs. dash) 14 | - In the past I had issues with LD_PRELOAD with BEAR, where /bin/sh 15 | used a different glibc than BEAR which came from my development shell. 16 | --- 17 | src/job.c | 2 +- 18 | 1 file changed, 1 insertion(+), 1 deletion(-) 19 | 20 | diff --git a/src/job.c b/src/job.c 21 | index ae1f18b..6b4ddb3 100644 22 | --- a/src/job.c 23 | +++ b/src/job.c 24 | @@ -77,7 +77,7 @@ char * vms_strsignal (int status); 25 | 26 | #else 27 | 28 | -const char *default_shell = "/bin/sh"; 29 | +const char *default_shell = "sh"; 30 | int batch_mode_shell = 0; 31 | 32 | #endif 33 | -- 34 | 2.31.1 35 | 36 | -------------------------------------------------------------------------------- /pkgs/gnumake/0002-remove-impure-dirs.patch: -------------------------------------------------------------------------------- 1 | From 795d63d3c8b5c0dbb7e544954f75507b371b7228 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= 3 | Date: Sat, 24 Apr 2021 10:20:16 +0200 4 | Subject: [PATCH 2/2] remove impure dirs 5 | 6 | --- 7 | src/read.c | 3 --- 8 | src/remake.c | 2 -- 9 | 2 files changed, 5 deletions(-) 10 | 11 | diff --git a/src/read.c b/src/read.c 12 | index fa197fb..defacfb 100644 13 | --- a/src/read.c 14 | +++ b/src/read.c 15 | @@ -109,9 +109,6 @@ static const char *default_include_directories[] = 16 | #endif 17 | INCLUDEDIR, 18 | #ifndef _AMIGA 19 | - "/usr/gnu/include", 20 | - "/usr/local/include", 21 | - "/usr/include", 22 | #endif 23 | 0 24 | }; 25 | diff --git a/src/remake.c b/src/remake.c 26 | index fb237c5..94bff7d 100644 27 | --- a/src/remake.c 28 | +++ b/src/remake.c 29 | @@ -1601,8 +1601,6 @@ library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr) 30 | static const char *dirs[] = 31 | { 32 | #ifndef _AMIGA 33 | - "/lib", 34 | - "/usr/lib", 35 | #endif 36 | #if defined(WINDOWS32) && !defined(LIBDIR) 37 | /* 38 | -- 39 | 2.31.1 40 | 41 | -------------------------------------------------------------------------------- /pkgs/gnumake/4.2/glibc-2.27-glob.patch: -------------------------------------------------------------------------------- 1 | diff -Naur glob/glob.c glob/glob.c 2 | --- glob/glob.c 2013-10-20 13:14:38.000000000 -0400 3 | +++ glob/glob.c 2018-03-16 14:32:38.483496170 -0400 4 | @@ -208,28 +208,9 @@ 5 | #endif /* __GNU_LIBRARY__ || __DJGPP__ */ 6 | 7 | 8 | -#if !defined __alloca && !defined __GNU_LIBRARY__ 9 | - 10 | -# ifdef __GNUC__ 11 | -# undef alloca 12 | -# define alloca(n) __builtin_alloca (n) 13 | -# else /* Not GCC. */ 14 | -# ifdef HAVE_ALLOCA_H 15 | # include 16 | -# else /* Not HAVE_ALLOCA_H. */ 17 | -# ifndef _AIX 18 | -# ifdef WINDOWS32 19 | -# include 20 | -# else 21 | -extern char *alloca (); 22 | -# endif /* WINDOWS32 */ 23 | -# endif /* Not _AIX. */ 24 | -# endif /* sparc or HAVE_ALLOCA_H. */ 25 | -# endif /* GCC. */ 26 | - 27 | # define __alloca alloca 28 | 29 | -#endif 30 | 31 | #ifndef __GNU_LIBRARY__ 32 | # define __stat stat 33 | -------------------------------------------------------------------------------- /pkgs/gnumake/4.2/glibc-2.33-glob.patch: -------------------------------------------------------------------------------- 1 | diff --git glob/glob.c glob/glob.c 2 | index 924f2b3..d4ef0c5 100644 3 | --- glob/glob.c 4 | +++ glob/glob.c 5 | @@ -212,8 +212,8 @@ my_realloc (p, n) 6 | # define __alloca alloca 7 | 8 | 9 | -#ifndef __GNU_LIBRARY__ 10 | # define __stat stat 11 | +#ifndef __GNU_LIBRARY__ 12 | # ifdef STAT_MACROS_BROKEN 13 | # undef S_ISDIR 14 | # endif 15 | -- 16 | 2.31.1 17 | 18 | -------------------------------------------------------------------------------- /pkgs/gnumake/4.2/impure-dirs.patch: -------------------------------------------------------------------------------- 1 | diff -rc read.c read.c 2 | *** read.c 2006-03-17 15:24:20.000000000 +0100 3 | --- read.c 2007-05-24 17:16:31.000000000 +0200 4 | *************** 5 | *** 99,107 **** 6 | --- 99,109 ---- 7 | #endif 8 | INCLUDEDIR, 9 | #ifndef _AMIGA 10 | + #if 0 11 | "/usr/gnu/include", 12 | "/usr/local/include", 13 | "/usr/include", 14 | + #endif 15 | #endif 16 | 0 17 | }; 18 | diff -rc reremake.c 19 | *** remake.c 2006-03-20 03:36:37.000000000 +0100 20 | --- remake.c 2007-05-24 17:06:54.000000000 +0200 21 | *************** 22 | *** 1452,1460 **** 23 | --- 1452,1462 ---- 24 | static char *dirs[] = 25 | { 26 | #ifndef _AMIGA 27 | + #if 0 28 | "/lib", 29 | "/usr/lib", 30 | #endif 31 | + #endif 32 | #if defined(WINDOWS32) && !defined(LIBDIR) 33 | /* 34 | * This is completely up to the user at product install time. Just define 35 | -------------------------------------------------------------------------------- /pkgs/gnupatch/Allow_input_files_to_be_missing_for_ed-style_patches.patch: -------------------------------------------------------------------------------- 1 | From b5a91a01e5d0897facdd0f49d64b76b0f02b43e1 Mon Sep 17 00:00:00 2001 2 | From: Andreas Gruenbacher 3 | Date: Fri, 6 Apr 2018 11:34:51 +0200 4 | Subject: Allow input files to be missing for ed-style patches 5 | 6 | * src/pch.c (do_ed_script): Allow input files to be missing so that new 7 | files will be created as with non-ed-style patches. 8 | --- 9 | src/pch.c | 8 +++++--- 10 | 1 file changed, 5 insertions(+), 3 deletions(-) 11 | 12 | diff --git a/src/pch.c b/src/pch.c 13 | index bc6278c..0c5cc26 100644 14 | --- a/src/pch.c 15 | +++ b/src/pch.c 16 | @@ -2394,9 +2394,11 @@ do_ed_script (char const *inname, char const *outname, 17 | 18 | if (! dry_run && ! skip_rest_of_patch) { 19 | int exclusive = *outname_needs_removal ? 0 : O_EXCL; 20 | - assert (! inerrno); 21 | - *outname_needs_removal = true; 22 | - copy_file (inname, outname, 0, exclusive, instat.st_mode, true); 23 | + if (inerrno != ENOENT) 24 | + { 25 | + *outname_needs_removal = true; 26 | + copy_file (inname, outname, 0, exclusive, instat.st_mode, true); 27 | + } 28 | sprintf (buf, "%s %s%s", editor_program, 29 | verbosity == VERBOSE ? "" : "- ", 30 | outname); 31 | -- 32 | cgit v1.0-41-gc330 33 | 34 | -------------------------------------------------------------------------------- /pkgs/gnupatch/CVE-2018-6951.patch: -------------------------------------------------------------------------------- 1 | From f290f48a621867084884bfff87f8093c15195e6a Mon Sep 17 00:00:00 2001 2 | From: Andreas Gruenbacher 3 | Date: Mon, 12 Feb 2018 16:48:24 +0100 4 | Subject: Fix segfault with mangled rename patch 5 | 6 | http://savannah.gnu.org/bugs/?53132 7 | * src/pch.c (intuit_diff_type): Ensure that two filenames are specified 8 | for renames and copies (fix the existing check). 9 | --- 10 | src/pch.c | 3 ++- 11 | 1 file changed, 2 insertions(+), 1 deletion(-) 12 | 13 | diff --git a/src/pch.c b/src/pch.c 14 | index ff9ed2c..bc6278c 100644 15 | --- a/src/pch.c 16 | +++ b/src/pch.c 17 | @@ -974,7 +974,8 @@ intuit_diff_type (bool need_header, mode_t *p_file_type) 18 | if ((pch_rename () || pch_copy ()) 19 | && ! inname 20 | && ! ((i == OLD || i == NEW) && 21 | - p_name[! reverse] && 22 | + p_name[reverse] && p_name[! reverse] && 23 | + name_is_valid (p_name[reverse]) && 24 | name_is_valid (p_name[! reverse]))) 25 | { 26 | say ("Cannot %s file without two valid file names\n", pch_rename () ? "rename" : "copy"); 27 | -- 28 | cgit v1.0-41-gc330 29 | -------------------------------------------------------------------------------- /pkgs/gnupatch/CVE-2018-6952.patch: -------------------------------------------------------------------------------- 1 | From 9c986353e420ead6e706262bf204d6e03322c300 Mon Sep 17 00:00:00 2001 2 | From: Andreas Gruenbacher 3 | Date: Fri, 17 Aug 2018 13:35:40 +0200 4 | Subject: Fix swapping fake lines in pch_swap 5 | 6 | * src/pch.c (pch_swap): Fix swapping p_bfake and p_efake when there is a 7 | blank line in the middle of a context-diff hunk: that empty line stays 8 | in the middle of the hunk and isn't swapped. 9 | 10 | Fixes: https://savannah.gnu.org/bugs/index.php?53133 11 | --- 12 | src/pch.c | 2 +- 13 | 1 file changed, 1 insertion(+), 1 deletion(-) 14 | 15 | diff --git a/src/pch.c b/src/pch.c 16 | index e92bc64..a500ad9 100644 17 | --- a/src/pch.c 18 | +++ b/src/pch.c 19 | @@ -2122,7 +2122,7 @@ pch_swap (void) 20 | } 21 | if (p_efake >= 0) { /* fix non-freeable ptr range */ 22 | if (p_efake <= i) 23 | - n = p_end - i + 1; 24 | + n = p_end - p_ptrn_lines; 25 | else 26 | n = -i; 27 | p_efake += n; 28 | -- 29 | -------------------------------------------------------------------------------- /pkgs/isl/0.11.1.nix: -------------------------------------------------------------------------------- 1 | import ./generic.nix { 2 | version = "0.11.1"; 3 | urls = [ 4 | "https://src.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2" 5 | ]; 6 | sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9"; 7 | patches = [ ./fix-gcc-build.diff ]; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/isl/0.14.1.nix: -------------------------------------------------------------------------------- 1 | import ./generic.nix rec { 2 | version = "0.14.1"; 3 | urls = [ 4 | "mirror://sourceforge/libisl/isl-${version}.tar.xz" 5 | "https://libisl.sourceforge.io/isl-${version}.tar.xz" 6 | ]; 7 | sha256 = "0xa6xagah5rywkywn19rzvbvhfvkmylhcxr6z9z7bz29cpiwk0l8"; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/isl/0.17.1.nix: -------------------------------------------------------------------------------- 1 | import ./generic.nix rec { 2 | version = "0.17.1"; 3 | urls = [ 4 | "mirror://sourceforge/libisl/isl-${version}.tar.xz" 5 | "https://libisl.sourceforge.io/isl-${version}.tar.xz" 6 | ]; 7 | sha256 = "be152e5c816b477594f4c6194b5666d8129f3a27702756ae9ff60346a8731647"; 8 | } 9 | -------------------------------------------------------------------------------- /pkgs/isl/0.20.0.nix: -------------------------------------------------------------------------------- 1 | import ./generic.nix rec { 2 | version = "0.20"; 3 | urls = [ 4 | "mirror://sourceforge/libisl/isl-${version}.tar.xz" 5 | "https://libisl.sourceforge.io/isl-${version}.tar.xz" 6 | ]; 7 | sha256 = "1akpgq0rbqbah5517blg2zlnfvjxfcl9cjrfc75nbcx5p2gnlnd5"; 8 | configureFlags = [ 9 | "--with-gcc-arch=generic" # don't guess -march=/mtune= 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/isl/0.24.0.nix: -------------------------------------------------------------------------------- 1 | import ./generic.nix rec { 2 | version = "0.24"; 3 | urls = [ 4 | "mirror://sourceforge/libisl/isl-${version}.tar.xz" 5 | "https://libisl.sourceforge.io/isl-${version}.tar.xz" 6 | ]; 7 | sha256 = "1bgbk6n93qqn7w8v21kxf4x6dc3z0ypqrzvgfd46nhagak60ac84"; 8 | configureFlags = [ 9 | "--with-gcc-arch=generic" # don't guess -march=/mtune= 10 | ]; 11 | } 12 | -------------------------------------------------------------------------------- /pkgs/isl/fix-gcc-build.diff: -------------------------------------------------------------------------------- 1 | diff -ru isl-0.11.1/include/isl/int.h isl-0.11.1.new/include/isl/int.h 2 | --- isl-0.11.1/include/isl/int.h 2012-11-29 09:47:32.000000000 +0100 3 | +++ isl-0.11.1.new/include/isl/int.h 2013-10-27 15:35:31.348553812 +0100 4 | @@ -14,7 +14,7 @@ 5 | #include 6 | #include 7 | #if defined(__cplusplus) 8 | -#include 9 | +#include 10 | #endif 11 | 12 | #if defined(__cplusplus) 13 | -------------------------------------------------------------------------------- /pkgs/isl/generic.nix: -------------------------------------------------------------------------------- 1 | { version 2 | , urls 3 | , sha256 4 | , configureFlags ? [] 5 | , patches ? [] 6 | }: 7 | 8 | { lib 9 | , stdenv 10 | , fetchurl 11 | , gmp 12 | , autoreconfHook 13 | , buildPackages 14 | }: 15 | 16 | stdenv.mkDerivation { 17 | pname = "isl"; 18 | inherit version; 19 | 20 | src = fetchurl { 21 | inherit urls sha256; 22 | }; 23 | 24 | inherit patches; 25 | 26 | strictDeps = true; 27 | depsBuildBuild = lib.optionals (lib.versionAtLeast version "0.24") [ buildPackages.stdenv.cc ]; 28 | nativeBuildInputs = lib.optionals (stdenv.hostPlatform.isRiscV && lib.versionOlder version "0.24") [ autoreconfHook ]; 29 | buildInputs = [ gmp ]; 30 | 31 | inherit configureFlags; 32 | 33 | enableParallelBuilding = true; 34 | 35 | meta = { 36 | homepage = "https://libisl.sourceforge.io/"; 37 | license = lib.licenses.lgpl21; 38 | description = "Library for manipulating sets and relations of integer points bounded by linear constraints"; 39 | platforms = lib.platforms.all; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/libidn2/no-bootstrap-reference.nix: -------------------------------------------------------------------------------- 1 | { stdenv, lib, libidn2, libunistring, runCommandLocal, patchelf }: 2 | # Construct a copy of libidn2.* where all (transitive) libc references (in .bin) 3 | # get replaced by a new one, so that there's no reference to bootstrap tools. 4 | runCommandLocal 5 | "${libidn2.pname}-${libidn2.version}" 6 | { 7 | outputs = [ "bin" "dev" "out" ]; 8 | passthru = { 9 | inherit (libidn2) out info devdoc; # no need to touch these store paths 10 | }; 11 | inherit (libidn2) meta; 12 | } 13 | '' 14 | cp -r '${libidn2.bin}' "$bin" 15 | chmod +w "$bin"/bin/* 16 | patchelf \ 17 | --set-interpreter '${stdenv.cc.bintools.dynamicLinker}' \ 18 | --set-rpath '${lib.concatMapStringsSep ":" (p: lib.getLib p + "/lib") 19 | [ stdenv.cc.libc libunistring libidn2 ]}' \ 20 | "$bin"/bin/* 21 | 22 | cp -r '${libidn2.dev}' "$dev" 23 | chmod +w "$dev"/nix-support/propagated-build-inputs 24 | substituteInPlace "$dev"/nix-support/propagated-build-inputs \ 25 | --replace '${libidn2.bin}' "$bin" 26 | substituteInPlace "$dev"/lib/pkgconfig/libidn2.pc \ 27 | --replace '${libidn2.dev}' "$dev" 28 | 29 | ln -s '${libidn2.out}' "$out" # it's hard to be without any $out 30 | '' 31 | 32 | -------------------------------------------------------------------------------- /pkgs/libtool/default.nix: -------------------------------------------------------------------------------- 1 | {lib, stdenv, fetchurl, m4, perl}: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "libtool"; 5 | version = "1.5.26"; 6 | 7 | src = fetchurl { 8 | url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz"; 9 | sha256 = "029ggq5kri1gjn6nfqmgw4w920gyfzscjjxbsxxidal5zqsawd8w"; 10 | }; 11 | 12 | nativeBuildInputs = [m4]; 13 | buildInputs = [perl]; 14 | 15 | # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the 16 | # "fixed" path in generated files! 17 | dontPatchShebangs = true; 18 | dontFixLibtool = true; 19 | 20 | meta = { 21 | description = "Generic library support script"; 22 | 23 | longDescription = '' 24 | GNU libtool is a generic library support script. Libtool hides 25 | the complexity of using shared libraries behind a consistent, 26 | portable interface. 27 | 28 | To use libtool, add the new generic library building commands to 29 | your Makefile, Makefile.in, or Makefile.am. See the 30 | documentation for details. 31 | ''; 32 | 33 | homepage = "https://www.gnu.org/software/libtool/"; 34 | 35 | license = lib.licenses.gpl2Plus; 36 | platforms = lib.platforms.unix; 37 | 38 | mainProgram = "libtool"; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /pkgs/lndir/default.nix: -------------------------------------------------------------------------------- 1 | { stdenv, pkg-config, fetchurl, xorgproto, testers }: stdenv.mkDerivation (finalAttrs: { 2 | pname = "lndir"; 3 | version = "1.0.5"; 4 | builder = ./builder.sh; 5 | src = fetchurl { 6 | url = "mirror://xorg/individual/util/lndir-1.0.5.tar.xz"; 7 | sha256 = "1nsd23kz6iqxfcis3432zq01i54n98b94m2gcsay1k3mamx5fr9v"; 8 | }; 9 | hardeningDisable = [ "bindnow" "relro" ]; 10 | strictDeps = true; 11 | nativeBuildInputs = [ pkg-config ]; 12 | buildInputs = [ xorgproto ]; 13 | passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 14 | meta = { 15 | pkgConfigModules = [ ]; 16 | platforms = lib.platforms.unix; 17 | }; 18 | }) 19 | 20 | -------------------------------------------------------------------------------- /pkgs/minizip/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, zlib, autoreconfHook }: 2 | 3 | stdenv.mkDerivation { 4 | pname = "minizip"; 5 | inherit (zlib) src version; 6 | 7 | patchFlags = [ "-p3" ]; 8 | 9 | nativeBuildInputs = [ autoreconfHook ]; 10 | buildInputs = [ zlib ]; 11 | 12 | sourceRoot = "zlib-${zlib.version}/contrib/minizip"; 13 | 14 | meta = { 15 | description = "Compression library implementing the deflate compression method found in gzip and PKZIP"; 16 | inherit (zlib.meta) license homepage; 17 | platforms = lib.platforms.unix; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /pkgs/patchelf/setup-hook.sh: -------------------------------------------------------------------------------- 1 | # This setup hook calls patchelf to automatically remove unneeded 2 | # directories from the RPATH of every library or executable in every 3 | # output. 4 | 5 | fixupOutputHooks+=('if [ -z "${dontPatchELF-}" ]; then patchELF "$prefix"; fi') 6 | 7 | patchELF() { 8 | local dir="$1" 9 | [ -e "$dir" ] || return 0 10 | 11 | echo "shrinking RPATHs of ELF executables and libraries in $dir" 12 | 13 | local i 14 | while IFS= read -r -d $'\0' i; do 15 | if [[ "$i" =~ .build-id ]]; then continue; fi 16 | if ! isELF "$i"; then continue; fi 17 | echo "shrinking $i" 18 | patchelf --shrink-rpath "$i" || true 19 | done < <(find "$dir" -type f -print0) 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/patchelf/unstable.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, autoreconfHook, fetchFromGitHub, unstableGitUpdater }: 2 | 3 | stdenv.mkDerivation { 4 | pname = "patchelf"; 5 | version = "0.18.0-unstable-2024-06-15"; 6 | 7 | src = fetchFromGitHub { 8 | owner = "NixOS"; 9 | repo = "patchelf"; 10 | rev = "a0f54334df36770b335c051e540ba40afcbf8378"; 11 | sha256 = "sha256-FSoxTcRZMGHNJh8dNtKOkcUtjhmhU6yQXcZZfUPLhQM="; 12 | }; 13 | 14 | # Drop test that fails on musl (?) 15 | postPatch = lib.optionalString stdenv.hostPlatform.isMusl '' 16 | substituteInPlace tests/Makefile.am \ 17 | --replace "set-rpath-library.sh" "" 18 | ''; 19 | 20 | setupHook = [ ./setup-hook.sh ]; 21 | 22 | nativeBuildInputs = [ autoreconfHook ]; 23 | buildInputs = [ ]; 24 | 25 | doCheck = !stdenv.isDarwin; 26 | 27 | passthru = { 28 | updateScript = unstableGitUpdater { 29 | url = "https://github.com/NixOS/patchelf.git"; 30 | }; 31 | }; 32 | 33 | meta = with lib; { 34 | homepage = "https://github.com/NixOS/patchelf"; 35 | license = licenses.gpl3; 36 | description = "Small utility to modify the dynamic linker and RPATH of ELF executables"; 37 | mainProgram = "patchelf"; 38 | maintainers = [ ]; 39 | platforms = platforms.all; 40 | }; 41 | } 42 | -------------------------------------------------------------------------------- /pkgs/perl/cpp-precomp.patch: -------------------------------------------------------------------------------- 1 | --- a/hints/darwin.sh 2013-05-08 11:13:45.000000000 -0600 2 | +++ b/hints/darwin.sh 2013-05-08 11:15:04.000000000 -0600 3 | @@ -129,7 +129,7 @@ 4 | 5 | # Avoid Apple's cpp precompiler, better for extensions 6 | if [ "X`echo | ${cc} -no-cpp-precomp -E - 2>&1 >/dev/null`" = "X" ]; then 7 | - cppflags="${cppflags} -no-cpp-precomp" 8 | + #cppflags="${cppflags} -no-cpp-precomp" 9 | 10 | # This is necessary because perl's build system doesn't 11 | # apply cppflags to cc compile lines as it should. 12 | -------------------------------------------------------------------------------- /pkgs/perl/ld-shared.patch: -------------------------------------------------------------------------------- 1 | $NetBSD: patch-hints_solaris__2.sh,v 1.2 2015/10/27 09:10:44 jperkin Exp $ 2 | 3 | Redo PR pkg/44999. 4 | 5 | --- perl-5.20.2/hints/solaris_2.sh.orig 2015-05-13 20:19:29.000000000 +0000 6 | +++ perl-5.20.2/hints/solaris_2.sh 7 | @@ -585,7 +585,7 @@ EOM 8 | fi 9 | fi 10 | case "${cc:-cc} -v 2>/dev/null" in 11 | - *gcc*) 12 | + *gcc*|clang*) 13 | echo 'int main() { return 0; }' > try.c 14 | case "`${cc:-cc} $ccflags -mcpu=v9 -m64 -S try.c 2>&1 | grep 'm64 is not supported by this configuration'`" in 15 | *"m64 is not supported"*) 16 | @@ -622,7 +622,7 @@ EOM 17 | # use that with Solaris 11 and later, but keep 18 | # the old behavior for older Solaris versions. 19 | case "$osvers" in 20 | - 2.?|2.10) lddlflags="$lddlflags -G -m64" ;; 21 | + 2.?|2.10) lddlflags="$lddlflags -shared -m64" ;; 22 | *) lddlflags="$lddlflags -shared -m64" ;; 23 | esac 24 | ;; 25 | -------------------------------------------------------------------------------- /pkgs/perl/setup-hook-cross.sh: -------------------------------------------------------------------------------- 1 | addPerlLibPath () { 2 | addToSearchPath PERL5LIB $1/lib/perl5/site_perl/@version@ 3 | addToSearchPath PERL5LIB $1/lib/perl5/site_perl/cross_perl/@version@ 4 | # Adding the arch-specific directory is morally incorrect, as 5 | # miniperl can't load the native modules there. However, it can 6 | # (and sometimes needs to) load and run some of the pure perl 7 | # code there, so we add it anyway. When needed, stubs can be put 8 | # into $1/lib/perl5/site_perl/cross_perl/@version@ 9 | addToSearchPath PERL5LIB $1/lib/perl5/site_perl/@version@/@runtimeArch@ 10 | } 11 | 12 | addEnvHooks "$hostOffset" addPerlLibPath 13 | -------------------------------------------------------------------------------- /pkgs/perl/setup-hook.sh: -------------------------------------------------------------------------------- 1 | addPerlLibPath () { 2 | addToSearchPath PERL5LIB $1/lib/perl5/site_perl 3 | } 4 | 5 | addEnvHooks "$hostOffset" addPerlLibPath 6 | -------------------------------------------------------------------------------- /pkgs/perl/sw_vers.patch: -------------------------------------------------------------------------------- 1 | diff --git a/hints/darwin.sh b/hints/darwin.sh 2 | index afadf53..80b7533 100644 3 | --- a/hints/darwin.sh 4 | +++ b/hints/darwin.sh 5 | @@ -329,7 +329,7 @@ EOM 6 | # sw_vers output what we want 7 | # "ProductVersion: 10.10.5" "10.10" 8 | # "ProductVersion: 10.11" "10.11" 9 | - prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'` 10 | + prodvers="${MACOSX_DEPLOYMENT_TARGET:-10.12}" 11 | case "$prodvers" in 12 | 10.*) 13 | add_macosx_version_min ccflags $prodvers 14 | -------------------------------------------------------------------------------- /pkgs/pkg-config/requires-private.patch: -------------------------------------------------------------------------------- 1 | diff --git a/main.c b/main.c 2 | index b61ca34..5a420c2 100644 3 | --- a/main.c 4 | +++ b/main.c 5 | @@ -602,10 +602,10 @@ main (int argc, char **argv) 6 | else 7 | disable_private_libs(); 8 | 9 | - /* honor Requires.private if any Cflags are requested or any static 10 | + /* honor Requires.private if any any static 11 | * libs are requested */ 12 | 13 | - if (pkg_flags & CFLAGS_ANY || want_requires_private || want_exists || 14 | + if (want_requires_private || 15 | (want_static_lib_list && (pkg_flags & LIBS_ANY))) 16 | enable_requires_private(); 17 | 18 | -------------------------------------------------------------------------------- /pkgs/python/catch_conflicts/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | catch_conflicts.py 4 | ================== 5 | 6 | The file catch_conflicts.py is in a subdirectory because, if it isn't, the 7 | /nix/store/ directory is added to sys.path causing a delay when building. 8 | 9 | Pointers: 10 | 11 | - https://docs.python.org/3/library/sys.html#sys.path 12 | 13 | - https://github.com/NixOS/nixpkgs/pull/23600 14 | -------------------------------------------------------------------------------- /pkgs/python/catch_conflicts/catch_conflicts_py2.py: -------------------------------------------------------------------------------- 1 | import pkg_resources 2 | import collections 3 | import sys 4 | 5 | do_abort = False 6 | packages = collections.defaultdict(list) 7 | 8 | for f in sys.path: 9 | for req in pkg_resources.find_distributions(f): 10 | if req not in packages[req.project_name]: 11 | # some exceptions inside buildPythonPackage 12 | if req.project_name in ['setuptools', 'pip', 'wheel']: 13 | continue 14 | packages[req.project_name].append(req) 15 | 16 | 17 | for name, duplicates in packages.items(): 18 | if len(duplicates) > 1: 19 | do_abort = True 20 | print("Found duplicated packages in closure for dependency '{}': ".format(name)) 21 | for dup in duplicates: 22 | print(" " + repr(dup)) 23 | 24 | if do_abort: 25 | print("") 26 | print( 27 | 'Package duplicates found in closure, see above. Usually this ' 28 | 'happens if two packages depend on different version ' 29 | 'of the same dependency.') 30 | sys.exit(1) 31 | -------------------------------------------------------------------------------- /pkgs/python/conda/default.nix: -------------------------------------------------------------------------------- 1 | { pkgs }: { 2 | 3 | # List of libraries that are needed for conda binary packages. 4 | # When installing a conda binary package, just extend 5 | # the `buildInputs` with `condaAutopatchLibs`. 6 | condaPatchelfLibs = builtins.map (p: p.lib or p) ([ 7 | pkgs.alsa-lib 8 | pkgs.cups 9 | pkgs.gcc-unwrapped 10 | pkgs.libGL 11 | ] ++ (with pkgs.xorg; [ 12 | libSM 13 | libICE 14 | libX11 15 | libXau 16 | libXdamage 17 | libXi 18 | libXrender 19 | libXrandr 20 | libXcomposite 21 | libXcursor 22 | libXtst 23 | libXScrnSaver]) 24 | ); 25 | } 26 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.5.2-tkinter-x11.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/setup.py 2008-02-04 17:41:02.000000000 -0600 2 | +++ src/setup.py 2008-07-02 02:11:28.671875000 -0500 3 | @@ -1277,12 +1279,6 @@ 4 | include_dirs.append('/usr/X11/include') 5 | added_lib_dirs.append('/usr/X11/lib') 6 | 7 | - # If Cygwin, then verify that X is installed before proceeding 8 | - if host_platform == 'cygwin': 9 | - x11_inc = find_file('X11/Xlib.h', [], include_dirs) 10 | - if x11_inc is None: 11 | - return 12 | - 13 | # Check for BLT extension 14 | if self.compiler.find_library_file(lib_dirs + added_lib_dirs, 15 | 'BLT8.0'): 16 | @@ -1300,9 +1296,8 @@ 17 | if host_platform in ['aix3', 'aix4']: 18 | libs.append('ld') 19 | 20 | - # Finally, link with the X11 libraries (not appropriate on cygwin) 21 | - if host_platform != "cygwin": 22 | - libs.append('X11') 23 | + # Finally, link with the X11 libraries 24 | + libs.append('X11') 25 | 26 | ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'], 27 | define_macros=[('WITH_APPINIT', 1)] + defs, 28 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.6.2-ssl-threads.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/Modules/_ssl.c 2009-01-26 10:55:41.000000000 -0600 2 | +++ src/Modules/_ssl.c 2009-08-20 00:04:59.346816700 -0500 3 | @@ -15,6 +15,10 @@ 4 | 5 | #include "Python.h" 6 | 7 | +#ifdef __CYGWIN__ 8 | +#undef WITH_THREAD 9 | +#endif 10 | + 11 | #ifdef WITH_THREAD 12 | #include "pythread.h" 13 | #define PySSL_BEGIN_ALLOW_THREADS { \ 14 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.6.5-export-PySignal_SetWakeupFd.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/Include/pyerrors.h 2008-06-08 23:58:54.000000000 -0500 2 | +++ src/Include/pyerrors.h 2010-05-12 04:19:31.535297200 -0500 3 | @@ -232,7 +232,7 @@ PyAPI_FUNC(int) PyErr_CheckSignals(void) 4 | PyAPI_FUNC(void) PyErr_SetInterrupt(void); 5 | 6 | /* In signalmodule.c */ 7 | -int PySignal_SetWakeupFd(int fd); 8 | +PyAPI_FUNC(int) PySignal_SetWakeupFd(int fd); 9 | 10 | /* Support for adding program text to SyntaxErrors */ 11 | PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int); 12 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.6.5-ncurses-abi6.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/Include/py_curses.h 2009-09-06 16:23:05.000000000 -0500 2 | +++ src/Include/py_curses.h 2010-04-14 15:21:23.008971400 -0500 3 | @@ -17,6 +17,13 @@ 4 | #define NCURSES_OPAQUE 0 5 | #endif /* __APPLE__ */ 6 | 7 | +#ifdef __CYGWIN__ 8 | +/* the following define is necessary for Cygwin; without it, the 9 | + Cygwin-supplied ncurses.h sets NCURSES_OPAQUE to 1, and then Python 10 | + can't get at the WINDOW flags field. */ 11 | +#define NCURSES_INTERNALS 12 | +#endif /* __CYGWIN__ */ 13 | + 14 | #ifdef __FreeBSD__ 15 | /* 16 | ** On FreeBSD, [n]curses.h and stdlib.h/wchar.h use different guards 17 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.7.3-dylib.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/Lib/distutils/unixccompiler.py.orig 2012-11-27 07:44:15.409993500 -0500 2 | +++ src/Lib/distutils/unixccompiler.py 2012-11-27 08:09:57.801770900 -0500 3 | @@ -141,6 +141,7 @@ 4 | static_lib_format = shared_lib_format = dylib_lib_format = "lib%s%s" 5 | if sys.platform == "cygwin": 6 | exe_extension = ".exe" 7 | + dylib_lib_extension = ".dll.a" 8 | 9 | def preprocess(self, source, 10 | output_file=None, macros=None, include_dirs=None, 11 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/2.7.3-no-libm.patch: -------------------------------------------------------------------------------- 1 | --- origsrc/setup.py.orig 2012-11-27 09:28:34.051770900 -0500 2 | +++ src/setup.py 2012-11-27 09:28:47.239270900 -0500 3 | @@ -470,7 +470,7 @@ 4 | 5 | # Check for MacOS X, which doesn't need libm.a at all 6 | math_libs = ['m'] 7 | - if host_platform in ['darwin', 'beos']: 8 | + if host_platform in ['darwin', 'beos', 'cygwin']: 9 | math_libs = [] 10 | 11 | # XXX Omitted modules: gl, pure, dl, SGI-specific modules 12 | -------------------------------------------------------------------------------- /pkgs/python/cpython/2.7/nix-store-mtime.patch: -------------------------------------------------------------------------------- 1 | diff -ru -x '*~' Python-2.7.1-orig/Python/import.c Python-2.7.1/Python/import.c 2 | --- Python-2.7.1-orig/Python/import.c 2010-05-20 20:37:55.000000000 +0200 3 | +++ Python-2.7.1/Python/import.c 2011-01-04 15:55:11.000000000 +0100 4 | @@ -751,7 +751,7 @@ 5 | return NULL; 6 | } 7 | pyc_mtime = PyMarshal_ReadLongFromFile(fp); 8 | - if (pyc_mtime != mtime) { 9 | + if (pyc_mtime != mtime && mtime != 1) { 10 | if (Py_VerboseFlag) 11 | PySys_WriteStderr("# %s has bad mtime\n", cpathname); 12 | fclose(fp); 13 | -------------------------------------------------------------------------------- /pkgs/python/cpython/3.11/darwin-libutil.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c 2 | index 40229bce0f..3cc604930e 100644 3 | --- a/Modules/posixmodule.c 4 | +++ b/Modules/posixmodule.c 5 | @@ -7258,7 +7258,7 @@ os_sched_getaffinity_impl(PyObject *module, pid_t pid) 6 | #ifdef HAVE_UTMP_H 7 | #include 8 | #endif /* HAVE_UTMP_H */ 9 | -#elif defined(HAVE_LIBUTIL_H) 10 | +#elif defined(HAVE_LIBUTIL_H) && !defined(__APPLE__) 11 | #include 12 | #elif defined(HAVE_UTIL_H) 13 | #include 14 | -------------------------------------------------------------------------------- /pkgs/python/cpython/3.13/virtualenv-permissions.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py 2 | index 4856594755..6769ab8026 100644 3 | --- a/Lib/venv/__init__.py 4 | +++ b/Lib/venv/__init__.py 5 | @@ -522,6 +522,7 @@ def skip_file(f): 6 | with open(dstfile, 'wb') as f: 7 | f.write(new_data) 8 | shutil.copymode(srcfile, dstfile) 9 | + os.chmod(dstfile, 0o644) 10 | 11 | def upgrade_dependencies(self, context): 12 | logger.debug( 13 | -------------------------------------------------------------------------------- /pkgs/python/cpython/3.7/darwin-libutil.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c 2 | index c3682b4..16826c6 100644 3 | --- a/Modules/posixmodule.c 4 | +++ b/Modules/posixmodule.c 5 | @@ -5880,15 +5880,13 @@ error: 6 | #if defined(HAVE_OPENPTY) || defined(HAVE_FORKPTY) || defined(HAVE_DEV_PTMX) 7 | #ifdef HAVE_PTY_H 8 | #include 9 | -#else 10 | +#endif 11 | #ifdef HAVE_LIBUTIL_H 12 | #include 13 | -#else 14 | +#endif 15 | #ifdef HAVE_UTIL_H 16 | #include 17 | -#endif /* HAVE_UTIL_H */ 18 | -#endif /* HAVE_LIBUTIL_H */ 19 | -#endif /* HAVE_PTY_H */ 20 | +#endif 21 | #ifdef HAVE_STROPTS_H 22 | #include 23 | #endif 24 | -------------------------------------------------------------------------------- /pkgs/python/cpython/3.9/darwin-tcl-tk.patch: -------------------------------------------------------------------------------- 1 | diff --git a/setup.py b/setup.py 2 | index 04eb6b2..2e1160d 100644 3 | --- a/setup.py 4 | +++ b/setup.py 5 | @@ -1981,8 +1981,8 @@ class PyBuildExt(build_ext): 6 | # Rather than complicate the code below, detecting and building 7 | # AquaTk is a separate method. Only one Tkinter will be built on 8 | # Darwin - either AquaTk, if it is found, or X11 based Tk. 9 | - if (MACOS and self.detect_tkinter_darwin()): 10 | - return True 11 | + # if (MACOS and self.detect_tkinter_darwin()): 12 | + # return True 13 | 14 | # Assume we haven't found any of the libraries or include files 15 | # The versions with dots are used on Unix, and the versions without 16 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/2.7-html.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python27-docs-html"; 7 | version = "2.7.18"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-html.tar.bz2"; 11 | sha256 = "03igxwpqc2lvzspnj78zz1prnmfwwj00jbvh1wsxvb0wayd5wi10"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python27 15 | cp -R ./ $out/share/doc/python27/html 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/2.7-pdf-a4.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python27-docs-pdf-a4"; 7 | version = "2.7.18"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-pdf-a4.tar.bz2"; 11 | sha256 = "0rxb2fpxwivjpk5wi2pl1fqibr4khf9s0yq6a49k9b4awi9nkb6v"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python27 15 | cp -R ./ $out/share/doc/python27/pdf-a4 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/2.7-pdf-letter.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python27-docs-pdf-letter"; 7 | version = "2.7.18"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-pdf-letter.tar.bz2"; 11 | sha256 = "07hbqvrdlq01cb95r1574bxqqhiqbkj4f92wzlq4d6dq1l272nan"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python27 15 | cp -R ./ $out/share/doc/python27/pdf-letter 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/2.7-text.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python27-docs-text"; 7 | version = "2.7.18"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/2.7.18/python-2.7.18-docs-text.tar.bz2"; 11 | sha256 = "1wj7mxs52kp5lmn5mvv574sygkfnk00kbz9ya9c03yfq5dd5nvy8"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python27 15 | cp -R ./ $out/share/doc/python27/text 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/3.10-html.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python310-docs-html"; 7 | version = "3.10.7"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/3.10.7/python-3.10.7-docs-html.tar.bz2"; 11 | sha256 = "0j86z1vmaghzj5i4frvzyfb9qwsmm09g4f4ssx5w27cm30b8k0v1"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python310 15 | cp -R ./ $out/share/doc/python310/html 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/3.10-pdf-a4.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python310-docs-pdf-a4"; 7 | version = "3.10.7"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/3.10.7/python-3.10.7-docs-pdf-a4.tar.bz2"; 11 | sha256 = "1gvi457dsj3ywwvxysp7idkk9ndngnby1dnfh1q8f5gv3kg4093r"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python310 15 | cp -R ./ $out/share/doc/python310/pdf-a4 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/3.10-pdf-letter.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python310-docs-pdf-letter"; 7 | version = "3.10.7"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/3.10.7/python-3.10.7-docs-pdf-letter.tar.bz2"; 11 | sha256 = "0hzq5n6absqsh21jp6j5iaim9a1wq69d8lc2assldzb2zg4i75hr"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python310 15 | cp -R ./ $out/share/doc/python310/pdf-letter 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/3.10-texinfo.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python310-docs-texinfo"; 7 | version = "3.10.7"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/3.10.7/python-3.10.7-docs-texinfo.tar.bz2"; 11 | sha256 = "0p0fifi84ijz4ng6krw7c1x965jhgysprkijblmlnax7x9rmqrdf"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/info 15 | cp ./python.info $out/share/info 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/3.10-text.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, lib, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "python310-docs-text"; 7 | version = "3.10.7"; 8 | 9 | src = fetchurl { 10 | url = "http://www.python.org/ftp/python/doc/3.10.7/python-3.10.7-docs-text.tar.bz2"; 11 | sha256 = "1zbmm2fvdjnl214y41yffyqw3ywfai5r5npc00n1wkfxsdp7gcc3"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/python310 15 | cp -R ./ $out/share/doc/python310/text 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/template-info.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "pythonMAJORMINOR-docs-TYPE"; 7 | version = "VERSION"; 8 | 9 | src = fetchurl { 10 | url = "URL"; 11 | sha256 = "SHA"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/info 15 | cp ./python.info $out/share/info 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/docs/template.nix: -------------------------------------------------------------------------------- 1 | # This file was generated and will be overwritten by ./generate.sh 2 | 3 | { stdenv, fetchurl }: 4 | 5 | stdenv.mkDerivation { 6 | pname = "pythonMAJORMINOR-docs-TYPE"; 7 | version = "VERSION"; 8 | 9 | src = fetchurl { 10 | url = "URL"; 11 | sha256 = "SHA"; 12 | }; 13 | installPhase = '' 14 | mkdir -p $out/share/doc/pythonMAJORMINOR 15 | cp -R ./ $out/share/doc/pythonMAJORMINOR/TYPE 16 | ''; 17 | meta = { 18 | maintainers = [ ]; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /pkgs/python/cpython/freebsd-cross.patch: -------------------------------------------------------------------------------- 1 | --- a/configure.ac 2024-06-07 09:17:50.608162031 -0700 2 | +++ b/configure.ac 2024-06-07 09:45:59.844518241 -0700 3 | @@ -554,6 +554,9 @@ 4 | *-*-wasi) 5 | ac_sys_system=WASI 6 | ;; 7 | + *-*-freebsd) 8 | + ac_sys_system=FreeBSD 9 | + ;; 10 | *) 11 | # for now, limit cross builds to known configurations 12 | MACHDEP="unknown" 13 | @@ -614,6 +617,9 @@ 14 | wasm32-*-* | wasm64-*-*) 15 | _host_cpu=$host_cpu 16 | ;; 17 | + x86_64-*-freebsd) 18 | + _host_cpu=x86_64 19 | + ;; 20 | *) 21 | # for now, limit cross builds to known configurations 22 | MACHDEP="unknown" 23 | -------------------------------------------------------------------------------- /pkgs/python/cpython/mimetypes.patch: -------------------------------------------------------------------------------- 1 | diff --git i/Lib/mimetypes.py w/Lib/mimetypes.py 2 | index f3343c8..ab5b886 100644 3 | --- i/Lib/mimetypes.py 4 | +++ w/Lib/mimetypes.py 5 | @@ -40,16 +40,8 @@ 6 | ] 7 | 8 | knownfiles = [ 9 | - "/etc/mime.types", 10 | - "/etc/httpd/mime.types", # Mac OS X 11 | - "/etc/httpd/conf/mime.types", # Apache 12 | - "/etc/apache/mime.types", # Apache 1 13 | - "/etc/apache2/mime.types", # Apache 2 14 | - "/usr/local/etc/httpd/conf/mime.types", 15 | - "/usr/local/lib/netscape/mime.types", 16 | - "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2 17 | - "/usr/local/etc/mime.types", # Apache 1.3 18 | - ] 19 | + "@mime-types@/etc/mime.types", 20 | +] 21 | 22 | inited = False 23 | _db = None 24 | -------------------------------------------------------------------------------- /pkgs/python/cpython/virtualenv-permissions.patch: -------------------------------------------------------------------------------- 1 | diff --git a/Lib/venv/__init__.py b/Lib/venv/__init__.py 2 | index caa7285..ad666ac 100644 3 | --- a/Lib/venv/__init__.py 4 | +++ b/Lib/venv/__init__.py 5 | @@ -379,7 +379,7 @@ class EnvBuilder: 6 | if data is not None: 7 | with open(dstfile, 'wb') as f: 8 | f.write(data) 9 | - shutil.copymode(srcfile, dstfile) 10 | + os.chmod(dstfile, 0o644) 11 | 12 | 13 | def create(env_dir, system_site_packages=False, clear=False, 14 | -------------------------------------------------------------------------------- /pkgs/python/hooks/conda-install-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use in case a conda binary package is installed 2 | echo "Sourcing conda install hook" 3 | 4 | condaInstallPhase(){ 5 | echo "Executing condaInstallPhase" 6 | runHook preInstall 7 | 8 | # There are two different formats of conda packages. 9 | # It either contains only a site-packages directory 10 | # or multiple top level directories. 11 | siteDir=@pythonSitePackages@ 12 | if [ -e ./site-packages ]; then 13 | mkdir -p $out/$siteDir 14 | cp -r ./site-packages/* $out/$siteDir 15 | else 16 | cp -r . $out 17 | rm $out/env-vars 18 | fi 19 | 20 | runHook postInstall 21 | echo "Finished executing condaInstallPhase" 22 | } 23 | 24 | if [ -z "${installPhase-}" ]; then 25 | echo "Using condaInstallPhase" 26 | installPhase=condaInstallPhase 27 | fi 28 | -------------------------------------------------------------------------------- /pkgs/python/hooks/conda-unpack-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use in case a conda binary package is fetched 2 | echo "Sourcing conda unpack hook" 3 | 4 | condaUnpackPhase(){ 5 | echo "Executing condaUnpackPhase" 6 | runHook preUnpack 7 | 8 | # use lbzip2 for parallel decompression (bz2 is slow) 9 | lbzip2 -dc -n $NIX_BUILD_CORES $src | tar --exclude='info' -x 10 | 11 | # runHook postUnpack # Calls find...? 12 | echo "Finished executing condaUnpackPhase" 13 | } 14 | 15 | if [ -z "${unpackPhase-}" ]; then 16 | echo "Using condaUnpackPhase" 17 | unpackPhase=condaUnpackPhase 18 | fi 19 | -------------------------------------------------------------------------------- /pkgs/python/hooks/egg-build-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use for eggs 2 | echo "Sourcing egg-build-hook" 3 | 4 | eggBuildPhase() { 5 | echo "Executing eggBuildPhase" 6 | runHook preBuild 7 | 8 | runHook postBuild 9 | echo "Finished executing eggBuildPhase" 10 | } 11 | 12 | if [ -z "${dontUseEggBuild-}" ] && [ -z "${buildPhase-}" ]; then 13 | echo "Using eggBuildPhase" 14 | buildPhase=eggBuildPhase 15 | fi 16 | -------------------------------------------------------------------------------- /pkgs/python/hooks/egg-install-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for eggs 2 | echo "Sourcing egg-install-hook" 3 | 4 | eggInstallPhase() { 5 | echo "Executing eggInstallPhase" 6 | runHook preInstall 7 | 8 | mkdir -p "$out/@pythonSitePackages@" 9 | export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" 10 | 11 | find 12 | @pythonInterpreter@ -m easy_install --prefix="$out" *.egg 13 | 14 | runHook postInstall 15 | echo "Finished executing eggInstallPhase" 16 | } 17 | 18 | if [ -z "${dontUseEggInstall-}" ] && [ -z "${installPhase-}" ]; then 19 | echo "Using eggInstallPhase" 20 | installPhase=eggInstallPhase 21 | fi 22 | -------------------------------------------------------------------------------- /pkgs/python/hooks/egg-unpack-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use in case an egg is fetched 2 | echo "Sourcing egg setup hook" 3 | 4 | eggUnpackPhase(){ 5 | echo "Executing eggUnpackPhase" 6 | runHook preUnpack 7 | 8 | cp "$src" "$(stripHash "$src")" 9 | 10 | # runHook postUnpack # Calls find...? 11 | echo "Finished executing eggUnpackPhase" 12 | } 13 | 14 | if [ -z "${dontUseEggUnpack-}" ] && [ -z "${unpackPhase-}" ]; then 15 | echo "Using eggUnpackPhase" 16 | unpackPhase=eggUnpackPhase 17 | fi 18 | -------------------------------------------------------------------------------- /pkgs/python/hooks/pip-install-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for pip. 2 | echo "Sourcing pip-install-hook" 3 | 4 | declare -a pipInstallFlags 5 | 6 | pipInstallPhase() { 7 | echo "Executing pipInstallPhase" 8 | runHook preInstall 9 | 10 | mkdir -p "$out/@pythonSitePackages@" 11 | export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" 12 | 13 | pushd dist || return 1 14 | @pythonInterpreter@ -m pip install ./*.whl --no-index --no-warn-script-location --prefix="$out" --no-cache $pipInstallFlags 15 | popd || return 1 16 | 17 | runHook postInstall 18 | echo "Finished executing pipInstallPhase" 19 | } 20 | 21 | if [ -z "${dontUsePipInstall-}" ] && [ -z "${installPhase-}" ]; then 22 | echo "Using pipInstallPhase" 23 | installPhase=pipInstallPhase 24 | fi 25 | -------------------------------------------------------------------------------- /pkgs/python/hooks/pypa-build-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use for pypa/build projects 2 | echo "Sourcing pypa-build-hook" 3 | 4 | pypaBuildPhase() { 5 | echo "Executing pypaBuildPhase" 6 | runHook preBuild 7 | 8 | echo "Creating a wheel..." 9 | @build@/bin/pyproject-build --no-isolation --outdir dist/ --wheel $pypaBuildFlags 10 | echo "Finished creating a wheel..." 11 | 12 | runHook postBuild 13 | echo "Finished executing pypaBuildPhase" 14 | } 15 | 16 | if [ -z "${dontUsePypaBuild-}" ] && [ -z "${buildPhase-}" ]; then 17 | echo "Using pypaBuildPhase" 18 | buildPhase=pypaBuildPhase 19 | fi 20 | -------------------------------------------------------------------------------- /pkgs/python/hooks/pypa-install-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for PyPA installer. 2 | echo "Sourcing pypa-install-hook" 3 | 4 | pypaInstallPhase() { 5 | echo "Executing pypaInstallPhase" 6 | runHook preInstall 7 | 8 | pushd dist > /dev/null 9 | 10 | for wheel in *.whl; do 11 | @pythonInterpreter@ -m installer --prefix "$out" "$wheel" 12 | echo "Successfully installed $wheel" 13 | done 14 | 15 | popd > /dev/null 16 | 17 | export PYTHONPATH="$out/@pythonSitePackages@:$PYTHONPATH" 18 | 19 | runHook postInstall 20 | echo "Finished executing pypaInstallPhase" 21 | } 22 | 23 | if [ -z "${dontUsePypaInstall-}" ] && [ -z "${installPhase-}" ]; then 24 | echo "Using pypaInstallPhase" 25 | installPhase=pypaInstallPhase 26 | fi 27 | -------------------------------------------------------------------------------- /pkgs/python/hooks/python-catch-conflicts-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for detecting conflicts in Python packages 2 | echo "Sourcing python-catch-conflicts-hook.sh" 3 | 4 | pythonCatchConflictsPhase() { 5 | PYTHONPATH="@setuptools@/@pythonSitePackages@:$PYTHONPATH" @pythonInterpreter@ @catchConflicts@ 6 | } 7 | 8 | if [ -z "${dontUsePythonCatchConflicts-}" ]; then 9 | preDistPhases+=" pythonCatchConflictsPhase" 10 | fi 11 | -------------------------------------------------------------------------------- /pkgs/python/hooks/python-imports-check-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for checking whether Python imports succeed 2 | echo "Sourcing python-imports-check-hook.sh" 3 | 4 | pythonImportsCheckPhase () { 5 | echo "Executing pythonImportsCheckPhase" 6 | 7 | if [ -n "$pythonImportsCheck" ]; then 8 | echo "Check whether the following modules can be imported: $pythonImportsCheck" 9 | pythonImportsCheckOutput=$out 10 | if [ -n "$python" ]; then 11 | echo "Using python specific output \$python for imports check" 12 | pythonImportsCheckOutput=$python 13 | fi 14 | export PYTHONPATH="$pythonImportsCheckOutput/@pythonSitePackages@:$PYTHONPATH" 15 | ( cd $pythonImportsCheckOutput && eval "@pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ[\"pythonImportsCheck\"].split()))'" ) 16 | fi 17 | } 18 | 19 | if [ -z "${dontUsePythonImportsCheck-}" ]; then 20 | echo "Using pythonImportsCheckPhase" 21 | preDistPhases+=" pythonImportsCheckPhase" 22 | fi 23 | -------------------------------------------------------------------------------- /pkgs/python/hooks/python-output-dist-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for storing dist folder (wheels/sdists) in a separate output 2 | echo "Sourcing python-catch-conflicts-hook.sh" 3 | 4 | pythonOutputDistPhase() { 5 | echo "Executing pythonOutputDistPhase" 6 | if [[ -d dist ]]; then 7 | mv "dist" "$dist" 8 | else 9 | cat >&2 </dev/null; then 6 | echo "ERROR: setuptools-rust has to be used alongside with rustPlatform.cargoSetupHook!" 7 | exit 1 8 | fi 9 | 10 | export PYO3_CROSS_LIB_DIR="@pyLibDir@" 11 | export CARGO_BUILD_TARGET=@cargoBuildTarget@ 12 | # TODO theoretically setting linker should not be required because it is 13 | # already set in pkgs/build-support/rust/hooks/default.nix but build fails 14 | # on missing linker without this. 15 | export CARGO_TARGET_@cargoLinkerVar@_LINKER=@targetLinker@ 16 | } 17 | 18 | preConfigureHooks+=(setuptoolsRustSetup) 19 | -------------------------------------------------------------------------------- /pkgs/python/hooks/unittest-check-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook for unittest. 2 | echo "Sourcing unittest-check-hook" 3 | 4 | unittestCheckPhase() { 5 | echo "Executing unittestCheckPhase" 6 | runHook preCheck 7 | 8 | eval "@pythonCheckInterpreter@ -m unittest discover $unittestFlagsArray" 9 | 10 | runHook postCheck 11 | echo "Finished executing unittestCheckPhase" 12 | } 13 | 14 | if [ -z "${dontUseUnittestCheck-}" ] && [ -z "${installCheckPhase-}" ]; then 15 | echo "Using unittestCheckPhase" 16 | preDistPhases+=" unittestCheckPhase" 17 | fi 18 | -------------------------------------------------------------------------------- /pkgs/python/hooks/venv-shell-hook.sh: -------------------------------------------------------------------------------- 1 | venvShellHook() { 2 | echo "Executing venvHook" 3 | runHook preShellHook 4 | 5 | if [ -d "${venvDir}" ]; then 6 | echo "Skipping venv creation, '${venvDir}' already exists" 7 | source "${venvDir}/bin/activate" 8 | else 9 | echo "Creating new venv environment in path: '${venvDir}'" 10 | @pythonInterpreter@ -m venv "${venvDir}" 11 | 12 | source "${venvDir}/bin/activate" 13 | runHook postVenvCreation 14 | fi 15 | 16 | runHook postShellHook 17 | echo "Finished executing venvShellHook" 18 | } 19 | 20 | if [ -z "${dontUseVenvShellHook:-}" ] && [ -z "${shellHook-}" ]; then 21 | echo "Using venvShellHook" 22 | if [ -z "${venvDir-}" ]; then 23 | echo "Error: \`venvDir\` should be set when using \`venvShellHook\`." 24 | exit 1 25 | else 26 | shellHook=venvShellHook 27 | fi 28 | fi 29 | -------------------------------------------------------------------------------- /pkgs/python/hooks/wheel-unpack-hook.sh: -------------------------------------------------------------------------------- 1 | # Setup hook to use in case a wheel is fetched 2 | echo "Sourcing wheel setup hook" 3 | 4 | wheelUnpackPhase(){ 5 | echo "Executing wheelUnpackPhase" 6 | runHook preUnpack 7 | 8 | mkdir -p dist 9 | cp "$src" "dist/$(stripHash "$src")" 10 | 11 | # runHook postUnpack # Calls find...? 12 | echo "Finished executing wheelUnpackPhase" 13 | } 14 | 15 | if [ -z "${dontUseWheelUnpack-}" ] && [ -z "${unpackPhase-}" ]; then 16 | echo "Using wheelUnpackPhase" 17 | unpackPhase=wheelUnpackPhase 18 | fi 19 | -------------------------------------------------------------------------------- /pkgs/python/pypy/dont_fetch_vendored_deps.patch: -------------------------------------------------------------------------------- 1 | diff -ur a/lib_pypy/pypy_tools/build_cffi_imports.py b/lib_pypy/pypy_tools/build_cffi_imports.py 2 | --- a/lib_pypy/pypy_tools/build_cffi_imports.py 2021-04-12 01:11:48.000000000 -0400 3 | +++ b/lib_pypy/pypy_tools/build_cffi_imports.py 2021-07-16 06:37:03.000000000 -0400 4 | @@ -225,6 +225,8 @@ 5 | 6 | print('*', ' '.join(args), file=sys.stderr) 7 | if embed_dependencies and key in cffi_dependencies: 8 | + print("Nixpkgs: skipping fetching/building dependency", key) 9 | + elif False: 10 | status, stdout, stderr = _build_dependency(key) 11 | if status != 0: 12 | failures.append((key, module)) 13 | -------------------------------------------------------------------------------- /pkgs/python/pypy/sqlite_paths.patch: -------------------------------------------------------------------------------- 1 | diff -ur a/lib_pypy/_sqlite3_build.py b/lib_pypy/_sqlite3_build.py 2 | --- a/lib_pypy/_sqlite3_build.py 2021-04-12 01:11:48.000000000 -0400 3 | +++ b/lib_pypy/_sqlite3_build.py 2021-07-14 18:08:33.000000000 -0400 4 | @@ -301,6 +301,8 @@ 5 | else: 6 | extra_args = dict( 7 | libraries=libraries, 8 | + include_dirs=['@dev@/include'], 9 | + library_dirs=['@out@/lib'] 10 | ) 11 | 12 | SOURCE = """ 13 | -------------------------------------------------------------------------------- /pkgs/python/pypy/tk_tcl_paths.patch: -------------------------------------------------------------------------------- 1 | --- a/lib_pypy/_tkinter/tklib_build.py 2 | +++ b/lib_pypy/_tkinter/tklib_build.py 3 | @@ -17,23 +17,14 @@ elif sys.platform == 'win32': 4 | incdirs = [] 5 | linklibs = ['tcl85', 'tk85'] 6 | libdirs = [] 7 | -elif sys.platform == 'darwin': 8 | - # homebrew 9 | - homebrew = os.environ.get('HOMEBREW_PREFIX', '') 10 | - incdirs = ['/usr/local/opt/tcl-tk/include'] 11 | - linklibs = ['tcl8.6', 'tk8.6'] 12 | - libdirs = [] 13 | - if homebrew: 14 | - incdirs.append(homebrew + '/include') 15 | - libdirs.append(homebrew + '/opt/tcl-tk/lib') 16 | else: 17 | # On some Linux distributions, the tcl and tk libraries are 18 | # stored in /usr/include, so we must check this case also 19 | - libdirs = [] 20 | + libdirs = ["@tcl@/lib", "@tk@/lib"] 21 | found = False 22 | for _ver in ['', '8.6', '8.5']: 23 | - incdirs = ['/usr/include/tcl' + _ver] 24 | - linklibs = ['tcl' + _ver, 'tk' + _ver] 25 | + incdirs = ['@tcl_dev@/include', '@tk_dev@/include'] 26 | + linklibs = ['@tcl_libprefix@', '@tk_libprefix@'] 27 | if os.path.isdir(incdirs[0]): 28 | found = True 29 | break 30 | -------------------------------------------------------------------------------- /pkgs/python/run_setup.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | import setuptools 4 | import tokenize 5 | 6 | __file__='setup.py'; 7 | 8 | exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec')) 9 | -------------------------------------------------------------------------------- /pkgs/python/setup-hook.nix: -------------------------------------------------------------------------------- 1 | { runCommand }: 2 | 3 | sitePackages: 4 | 5 | let 6 | hook = ./setup-hook.sh; 7 | in runCommand "python-setup-hook.sh" { 8 | strictDeps = true; 9 | env = { 10 | inherit sitePackages; 11 | }; 12 | } '' 13 | cp ${hook} hook.sh 14 | substituteAllInPlace hook.sh 15 | mv hook.sh $out 16 | '' 17 | -------------------------------------------------------------------------------- /pkgs/python/setup-hook.sh: -------------------------------------------------------------------------------- 1 | addPythonPath() { 2 | addToSearchPathWithCustomDelimiter : PYTHONPATH $1/@sitePackages@ 3 | } 4 | 5 | toPythonPath() { 6 | local paths="$1" 7 | local result= 8 | for i in $paths; do 9 | p="$i/@sitePackages@" 10 | result="${result}${result:+:}$p" 11 | done 12 | echo $result 13 | } 14 | 15 | if [ -z "${dontAddPythonPath:-}" ]; then 16 | addEnvHooks "$hostOffset" addPythonPath 17 | fi 18 | 19 | # Determinism: The interpreter is patched to write null timestamps when compiling python files. 20 | # This way python doesn't try to update them when we freeze timestamps in nix store. 21 | export DETERMINISTIC_BUILD=1; 22 | # Determinism: We fix the hashes of str, bytes and datetime objects. 23 | export PYTHONHASHSEED=0; 24 | # Determinism. Whenever Python is included, it should not check user site-packages. 25 | # This option is only relevant when the sandbox is disabled. 26 | export PYTHONNOUSERSITE=1; 27 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_cpython_gdb/default.nix: -------------------------------------------------------------------------------- 1 | { interpreter, gdb, writeText, runCommand }: 2 | 3 | let 4 | crashme-py = writeText "crashme.py" '' 5 | import ctypes 6 | 7 | def sentinel_foo_bar(): 8 | ctypes.memset(0, 1, 1) 9 | 10 | sentinel_foo_bar() 11 | ''; 12 | in runCommand "python-gdb" {} '' 13 | # test that gdb is able to recover the python stack frame of this segfault 14 | ${gdb}/bin/gdb -batch -ex 'set debug-file-directory ${interpreter.debug}/lib/debug' \ 15 | -ex 'source ${interpreter}/share/gdb/libpython.py' \ 16 | -ex r \ 17 | -ex py-bt \ 18 | --args ${interpreter}/bin/python ${crashme-py} | grep 'in sentinel_foo_bar' > /dev/null 19 | 20 | # success. 21 | touch $out 22 | '' 23 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/default.nix: -------------------------------------------------------------------------------- 1 | { interpreter, writeText, runCommand }: 2 | 3 | let 4 | 5 | python = let 6 | packageOverrides = self: super: { 7 | typeddep = self.callPackage ./typeddep {}; 8 | }; 9 | in interpreter.override {inherit packageOverrides; self = python;}; 10 | 11 | pythonEnv = python.withPackages(ps: [ 12 | ps.typeddep 13 | ps.mypy 14 | ]); 15 | 16 | pythonScript = writeText "myscript.py" '' 17 | from typeddep import util 18 | s: str = util.echo("hello") 19 | print(s) 20 | ''; 21 | 22 | in runCommand "${interpreter.name}-site-prefix-mypy-test" {} '' 23 | ${pythonEnv}/bin/mypy ${pythonScript} 24 | touch $out 25 | '' 26 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/typeddep/default.nix: -------------------------------------------------------------------------------- 1 | { lib, buildPythonPackage, pythonOlder }: 2 | 3 | 4 | buildPythonPackage { 5 | 6 | pname = "typeddep"; 7 | version = "1.3.3.7"; 8 | 9 | src = lib.fileset.toSource { 10 | root = ./.; 11 | fileset = lib.fileset.unions [ 12 | ./setup.py 13 | ./typeddep 14 | ]; 15 | }; 16 | 17 | disabled = pythonOlder "3.7"; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/typeddep/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup 2 | 3 | setup(**{ 4 | 'name': 'typeddep', 5 | 'version': '1.3.3.7', 6 | 'description': 'Minimal repro to test mypy and site prefixes with Nix', 7 | 'long_description': None, 8 | 'author': 'adisbladis', 9 | 'author_email': 'adisbladis@gmail.com', 10 | 'maintainer': None, 11 | 'maintainer_email': None, 12 | 'url': None, 13 | 'packages': ['typeddep'], 14 | 'package_data': {'': ['*']}, 15 | 'install_requires': [], 16 | 'entry_points': {}, 17 | 'python_requires': '>=3.7,<4.0', 18 | }) 19 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/typeddep/typeddep/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekala-project/stdenv/8593af2030421f4668b7aefe38c9aecf63c6effa/pkgs/python/tests/test_nix_pythonprefix/typeddep/typeddep/__init__.py -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/typeddep/typeddep/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ekala-project/stdenv/8593af2030421f4668b7aefe38c9aecf63c6effa/pkgs/python/tests/test_nix_pythonprefix/typeddep/typeddep/py.typed -------------------------------------------------------------------------------- /pkgs/python/tests/test_nix_pythonprefix/typeddep/typeddep/util.py: -------------------------------------------------------------------------------- 1 | def echo(s: str) -> str: 2 | return s 3 | -------------------------------------------------------------------------------- /pkgs/python/tests/test_tkinter/default.nix: -------------------------------------------------------------------------------- 1 | { interpreter, writeText, runCommand }: 2 | 3 | let 4 | 5 | pythonEnv = interpreter.withPackages(ps: [ 6 | ps.tkinter 7 | ]); 8 | 9 | pythonScript = writeText "myscript.py" '' 10 | import tkinter 11 | print(tkinter) 12 | ''; 13 | 14 | in runCommand "${interpreter.name}-tkinter-test" {} '' 15 | ${pythonEnv}/bin/python ${pythonScript} 16 | touch $out 17 | '' 18 | -------------------------------------------------------------------------------- /pkgs/python/update-python-libraries/default.nix: -------------------------------------------------------------------------------- 1 | { python3, runCommand, git, nix, nix-prefetch-git }: 2 | 3 | runCommand "update-python-libraries" { 4 | buildInputs = [ 5 | nix 6 | nix-prefetch-git 7 | (python3.withPackages(ps: with ps; [ packaging requests toolz ])) 8 | git 9 | ]; 10 | } '' 11 | cp ${./update-python-libraries.py} $out 12 | patchShebangs $out 13 | substituteInPlace $out --replace 'GIT = "git"' 'GIT = "${git}/bin/git"' 14 | '' 15 | -------------------------------------------------------------------------------- /pkgs/python/with-packages.nix: -------------------------------------------------------------------------------- 1 | { buildEnv, pythonPackages }: 2 | 3 | f: let packages = f pythonPackages; in buildEnv.override { extraLibs = packages; } 4 | -------------------------------------------------------------------------------- /pkgs/readline/link-against-ncurses.patch: -------------------------------------------------------------------------------- 1 | This patch is to make sure that `libncurses' is among the `NEEDED' 2 | dependencies of `libreadline.so' and `libhistory.so'. 3 | 4 | Failing to do that, applications linking against Readline are 5 | forced to explicitly link against libncurses as well; in addition, 6 | this trick doesn't work when using GNU ld's `--as-needed'. 7 | 8 | --- shlib/Makefile.in 2009-01-06 18:03:22.000000000 +0100 9 | +++ shlib/Makefile.in 2009-07-27 14:43:25.000000000 +0200 10 | @@ -84,7 +84,7 @@ SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@ 11 | SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@ 12 | SHOBJ_LIBS = @SHOBJ_LIBS@ 13 | 14 | -SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ 15 | +SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ -lncurses 16 | SHLIB_LIBS = @SHLIB_LIBS@ 17 | 18 | SHLIB_DOT = @SHLIB_DOT@ 19 | -------------------------------------------------------------------------------- /pkgs/readline/no-arch_only-6.3.patch: -------------------------------------------------------------------------------- 1 | diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf 2 | --- support/shobj-conf 2014-02-24 03:06:29.000000000 +0100 3 | +++ support/shobj-conf 2014-07-22 11:18:52.000000000 +0200 4 | @@ -194,9 +194,6 @@ 5 | # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4 6 | *) 7 | case "${host_os}" in 8 | - darwin[89]*|darwin1[012]*) 9 | - SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`' 10 | - ;; 11 | *) # Mac OS X 10.9 (Mavericks) and later 12 | SHOBJ_ARCHFLAGS= 13 | # for 32 and 64bit universal library 14 | -------------------------------------------------------------------------------- /pkgs/readline/no-arch_only-8.2.patch: -------------------------------------------------------------------------------- 1 | diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf 2 | --- support/shobj-conf 2014-02-24 03:06:29.000000000 +0100 3 | +++ support/shobj-conf 2014-07-22 11:18:52.000000000 +0200 4 | @@ -159,9 +159,6 @@ 5 | # Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4 6 | *) 7 | case "${host_os}" in 8 | - darwin[89]*|darwin1[012]*) 9 | - SHOBJ_ARCHFLAGS= 10 | - ;; 11 | *) # Mac OS X 10.9 (Mavericks) and later 12 | SHOBJ_ARCHFLAGS= 13 | # for 32 and 64bit universal library 14 | -------------------------------------------------------------------------------- /pkgs/readline/readline-7.0-patches.nix: -------------------------------------------------------------------------------- 1 | # Automatically generated by `update-patch-set.sh'; do not edit. 2 | 3 | patch: [ 4 | (patch "001" "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs") 5 | (patch "002" "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7") 6 | (patch "003" "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy") 7 | (patch "004" "0r3bbaf12iz8m02z6p3fzww2m365fhn71xmzab2p62gj54s6h9gr") 8 | (patch "005" "0lxpa4f72y2nsgj6fgrhjk2nmmxvccys6aciwfxwchb5f21rq5fa") 9 | ] 10 | -------------------------------------------------------------------------------- /pkgs/readline/readline-8.2-patches.nix: -------------------------------------------------------------------------------- 1 | # Automatically generated by `update-patch-set.sh'; do not edit. 2 | 3 | patch: [ 4 | (patch "001" "1xxgfgr6hn3ads8m8xsrdi1kbx1f3s69k0danpd9x4haqhg7zydv") 5 | (patch "002" "0ly0siy6qy3l7hv12847adpfa34yq1w4qz9qkw6vrxv25j106rg0") 6 | (patch "003" "1c5cwvvkx9mfmpaapymq9cavmzh4fnagkjlchsqx4vml8sx8gx94") 7 | (patch "004" "1b15sndx9v5vj3x1f3h73099nlagknx4rbfpd5ldrbw2xgm2wmvr") 8 | (patch "005" "16ac25jz1a1mgkpfp1sydqf6qpsfh0s0dcmrnjpqbhg5va3s6av2") 9 | (patch "006" "18gmh6y3klh0vv28cyqz4is3rlb32pl7f1kf5r482kfjq3w5zd67") 10 | (patch "007" "1xmnpahs983n4w0gn3j0wr8nh1dpva33yj7fvfmhm46ph2wsa4ar") 11 | (patch "008" "0smjjzhwxi2ibpdisnk53lh1pzgka6rhlqyh3662xy69v34ysxx1") 12 | (patch "009" "05m1fwbs7mbs3pz3pg87gbbayandrrcgaqawzliqb6g1jbk8b61x") 13 | (patch "010" "0k3vyrjs2g6y2cfs03l2gp37fhxgqpiwvxb1c7z4q88cbb32x3km") 14 | ] 15 | -------------------------------------------------------------------------------- /pkgs/readline/update-patch-set.sh: -------------------------------------------------------------------------------- 1 | ../../../shells/bash/update-patch-set.sh -------------------------------------------------------------------------------- /pkgs/setup-hooks/update-autotools-gnu-config-scripts.sh: -------------------------------------------------------------------------------- 1 | preConfigurePhases+=" updateAutotoolsGnuConfigScriptsPhase" 2 | 3 | updateAutotoolsGnuConfigScriptsPhase() { 4 | if [ -n "${dontUpdateAutotoolsGnuConfigScripts-}" ]; then return; fi 5 | 6 | for script in config.sub config.guess; do 7 | for f in $(find . -type f -name "$script"); do 8 | echo "Updating Autotools / GNU config script to a newer upstream version: $f" 9 | cp -f "@gnu_config@/$script" "$f" 10 | done 11 | done 12 | } 13 | -------------------------------------------------------------------------------- /pkgs/stdenv/default.nix: -------------------------------------------------------------------------------- 1 | stdenvNo 2 | -------------------------------------------------------------------------------- /pkgs/texinfo/cross-tools-flags.patch: -------------------------------------------------------------------------------- 1 | diff -ur texinfo-6.5/configure texinfo-6.5-patched/configure 2 | --- texinfo-6.5/configure 2017-09-13 03:50:18.000000000 +0900 3 | +++ texinfo-6.5-patched/configure 2019-12-28 17:39:06.692818866 +0900 4 | @@ -23281,7 +23281,7 @@ 5 | # env -i gives this build host configure a clean environment; 6 | # consequently, we have to re-initialize $PATH. 7 | - env -i CC="$BUILD_CC" AR="$BUILD_AR" RANLIB="$BUILD_RANLIB" \ 8 | - PATH="$PATH" \ 9 | + env -i CC="$CC_FOR_BUILD" AR="$AR_FOR_BUILD" RANLIB="$RANLIB_FOR_BUILD" \ 10 | + PATH="$PATH" CFLAGS="$NATIVE_TOOLS_CFLAGS" LDFLAGS="$NATIVE_TOOLS_LDFLAGS" \ 11 | tools_only=1 \ 12 | ${confdir}/configure --build=${build} --host=${build} \ 13 | --disable-rpath --disable-nls 14 | -------------------------------------------------------------------------------- /pkgs/which/default.nix: -------------------------------------------------------------------------------- 1 | { lib, stdenv, fetchurl }: 2 | 3 | stdenv.mkDerivation rec { 4 | pname = "which"; 5 | version = "2.21"; 6 | 7 | src = fetchurl { 8 | url = "mirror://gnu/which/which-${version}.tar.gz"; 9 | hash = "sha256-9KJFuUEks3fYtJZGv0IfkVXTaqdhS26/g3BdP/x26q0="; 10 | }; 11 | 12 | strictDeps = true; 13 | enableParallelBuilding = true; 14 | 15 | env.NIX_CFLAGS_COMPILE = toString ( 16 | # Enable 64-bit file API. Otherwise `which` fails to find tools 17 | # on filesystems with 64-bit inodes (like `btrfs`) when running 18 | # binaries from 32-bit systems (like `i686-linux`). 19 | lib.optional stdenv.hostPlatform.is32bit "-D_FILE_OFFSET_BITS=64" 20 | ); 21 | 22 | meta = { 23 | homepage = "https://www.gnu.org/software/which/"; 24 | description = "Shows the full path of (shell) commands"; 25 | license = lib.licenses.gpl3Plus; 26 | mainProgram = "which"; 27 | platforms = lib.platforms.all; 28 | }; 29 | } 30 | -------------------------------------------------------------------------------- /systems/flake-systems.nix: -------------------------------------------------------------------------------- 1 | # See [RFC 46] for mandated platform support and ../../pkgs/stdenv for 2 | # implemented platform support. This list is mainly descriptive, i.e. all 3 | # system doubles for platforms where nixpkgs can do native compilation 4 | # reasonably well are included. 5 | # 6 | # [RFC 46]: https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md 7 | { }: 8 | 9 | [ 10 | # Tier 1 11 | "x86_64-linux" 12 | # Tier 2 13 | "aarch64-linux" 14 | "x86_64-darwin" 15 | # Tier 3 16 | "armv6l-linux" 17 | "armv7l-linux" 18 | "i686-linux" 19 | # "mipsel-linux" is excluded because it is not bootstrapped 20 | 21 | # Other platforms with sufficient support in stdenv which is not formally 22 | # mandated by their platform tier. 23 | "aarch64-darwin" 24 | # "armv5tel-linux" is excluded because it is not bootstrapped 25 | "powerpc64le-linux" 26 | "riscv64-linux" 27 | "x86_64-freebsd" 28 | ] 29 | -------------------------------------------------------------------------------- /tests/succeedOnFailure.nix: -------------------------------------------------------------------------------- 1 | { stdenv }: 2 | 3 | stdenv.mkDerivation { 4 | name = "stdenv-test-succeedOnFailure"; 5 | 6 | succeedOnFailure = true; 7 | 8 | passAsFile = [ "buildCommand" ]; 9 | buildCommand = '' 10 | mkdir $out 11 | echo foo > $out/foo 12 | exit 1 13 | ''; 14 | } 15 | --------------------------------------------------------------------------------