diff options
Diffstat (limited to 'nixpkgs/pkgs/by-name/me')
18 files changed, 838 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/me/megapixels/package.nix b/nixpkgs/pkgs/by-name/me/megapixels/package.nix new file mode 100644 index 000000000000..eef5e4c7add3 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/megapixels/package.nix @@ -0,0 +1,78 @@ +{ stdenv +, lib +, fetchFromGitLab +, glib +, meson +, ninja +, pkg-config +, wrapGAppsHook4 +, feedbackd +, gtk4 +, libepoxy +, xorg +, zbar +, tiffSupport ? true +, libraw +, jpgSupport ? true +, graphicsmagick +, exiftool +}: + +assert jpgSupport -> tiffSupport; + +let + inherit (lib) makeBinPath optional optionals optionalString; + runtimePath = makeBinPath ( + optional tiffSupport libraw + ++ optionals jpgSupport [ graphicsmagick exiftool ] + ); +in +stdenv.mkDerivation (finalAttrs: { + pname = "megapixels"; + version = "1.8.0"; + + src = fetchFromGitLab { + owner = "megapixels-org"; + repo = "Megapixels"; + rev = finalAttrs.version; + hash = "sha256-J94kDSqQkfdltbYbzvJofd5o/Dhivtld475CaQs7+Ok="; + }; + + nativeBuildInputs = [ + glib + meson + ninja + pkg-config + wrapGAppsHook4 + ]; + + buildInputs = [ + feedbackd + gtk4 + libepoxy + xorg.libXrandr + zbar + ]; + + postInstall = '' + glib-compile-schemas $out/share/glib-2.0/schemas + ''; + + preFixup = optionalString (tiffSupport || jpgSupport) '' + gappsWrapperArgs+=( + --prefix PATH : ${lib.escapeShellArg runtimePath} + ) + ''; + + strictDeps = true; + + meta = with lib; { + description = "GTK4 camera application that knows how to deal with the media request api"; + homepage = "https://gitlab.com/megapixels-org/Megapixels"; + changelog = "https://gitlab.com/megapixels-org/Megapixels/-/tags/${finalAttrs.version}"; + license = licenses.gpl3Only; + maintainers = with maintainers; [ dotlambda Luflosi ]; + platforms = platforms.linux; + mainProgram = "megapixels"; + }; +}) diff --git a/nixpkgs/pkgs/by-name/me/memtree/package.nix b/nixpkgs/pkgs/by-name/me/memtree/package.nix new file mode 100644 index 000000000000..528323624805 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/memtree/package.nix @@ -0,0 +1,46 @@ +{ lib +, fetchFromGitHub +, nix-update-script +, python3Packages +}: + +python3Packages.buildPythonApplication { + pname = "memtree"; + version = "unstable-2024-01-04"; + pyproject = true; + + src = fetchFromGitHub { + owner = "nbraud"; + repo = "memtree"; + rev = "97615952eabdc5e8e1a4bd590dd1f4971f3c5a24"; + hash = "sha256-Ifp8hwkuyBw57fGer3GbDiJaRjL4TD3hzj+ecGXWqI0="; + }; + + nativeBuildInputs = with python3Packages; [ + poetry-core + ]; + + propagatedBuildInputs = with python3Packages; [ + rich + ]; + + nativeCheckInputs = with python3Packages; [ + hypothesis + pytestCheckHook + ]; + + pytestFlagsArray = [ "-v" ]; + pythonImportsCheck = [ "memtree" ]; + + passthru.updateScript = nix-update-script { + extraArgs = [ "--version=branch" ]; + }; + + meta = with lib; { + description = "Render cgroups tree annotated by memory usage"; + homepage = "https://github.com/nbraud/memtree"; + maintainers = with maintainers; [ nicoo ]; + mainProgram = "memtree"; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/by-name/me/menulibre/package.nix b/nixpkgs/pkgs/by-name/me/menulibre/package.nix new file mode 100644 index 000000000000..5abe3a2bb47a --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/menulibre/package.nix @@ -0,0 +1,61 @@ +{ lib +, fetchFromGitHub +, python3Packages +, gnome-menus +, gtk3 +, intltool +, gobject-introspection +, wrapGAppsHook +, testers +, menulibre +}: + +python3Packages.buildPythonApplication rec { + name = "menulibre"; + version = "2.2.3"; + + src = fetchFromGitHub { + owner = "bluesabre"; + repo = "menulibre"; + rev = "menulibre-${version}"; + hash = "sha256-E0ukq3q4YaakOI2mDs3dh0ncZX/dqspCA+97r3JwWyA="; + }; + + propagatedBuildInputs = with python3Packages; [ + pygobject3 + gnome-menus + psutil + distutils-extra + ]; + + nativeBuildInputs = [ + gtk3 + intltool + gobject-introspection + wrapGAppsHook + ]; + + postPatch = '' + substituteInPlace setup.py \ + --replace-fail 'data_dir =' "data_dir = '$out/share/menulibre' #" \ + --replace-fail 'update_desktop_file(desktop_file, script_path)' "" + ''; + + preBuild = '' + export HOME=$TMPDIR + ''; + + passthru.tests.version = testers.testVersion { + package = menulibre; + command = "HOME=$TMPDIR menulibre --version | cut -d' ' -f2"; + }; + + meta = with lib; { + description = "An advanced menu editor with an easy-to-use interface"; + homepage = "https://bluesabre.org/projects/menulibre"; + license = licenses.gpl3Plus; + maintainers = with maintainers; [ lelgenio ]; + mainProgram = "menulibre"; + platforms = platforms.linux; + }; +} diff --git a/nixpkgs/pkgs/by-name/me/mercure/package.nix b/nixpkgs/pkgs/by-name/me/mercure/package.nix new file mode 100644 index 000000000000..f489155b4c25 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/mercure/package.nix @@ -0,0 +1,53 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, nix-update-script +, testers +, mercure +}: + +buildGoModule rec { + pname = "mercure"; + version = "0.15.9"; + + src = fetchFromGitHub { + owner = "dunglas"; + repo = "mercure"; + rev = "v${version}"; + hash = "sha256-4Y+yZSZrBDLPbQXaOCSKk/EY20Ka8CS4ivUg1TEaqXo="; + }; + + sourceRoot = "source/caddy"; + + vendorHash = "sha256-N0RmvhBlTiWmBb4TzLmaThD9jVkKgcIO9vPWxJAvLRQ="; + + subPackages = [ "mercure" ]; + excludedPackages = [ "../cmd/mercure" ]; + + ldflags = [ + "-s" + "-w" + "-X 'github.com/caddyserver/caddy/v2.CustomVersion=Mercure.rocks v${version} Caddy'" + ]; + + doCheck = false; + + passthru = { + updateScript = nix-update-script { }; + tests.version = testers.testVersion { + version = "v${version}"; + package = mercure; + command = "mercure version"; + }; + }; + + meta = with lib; { + description = "An open, easy, fast, reliable and battery-efficient solution for real-time communications"; + homepage = "https://github.com/dunglas/mercure"; + changelog = "https://github.com/dunglas/mercure/releases/tag/v${version}"; + license = licenses.agpl3Only; + maintainers = with maintainers; [ gaelreyrol ]; + platforms = platforms.unix; + mainProgram = "mercure"; + }; +} diff --git a/nixpkgs/pkgs/by-name/me/meritous/package.nix b/nixpkgs/pkgs/by-name/me/meritous/package.nix new file mode 100644 index 000000000000..8b0a176938aa --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meritous/package.nix @@ -0,0 +1,42 @@ +{ lib, stdenv, fetchFromGitLab, SDL, SDL_image, SDL_mixer, zlib }: + +stdenv.mkDerivation (finalAttrs: { + pname = "meritous"; + version = "1.5"; + + src = fetchFromGitLab { + owner = "meritous"; + repo = "meritous"; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-6KK2anjX+fPsYf4HSOHQ0EQBINqZiVbxo1RmBR6pslg="; + }; + + prePatch = '' + substituteInPlace Makefile \ + --replace "prefix=/usr/local" "prefix=$out" \ + --replace sdl-config ${lib.getDev SDL}/bin/sdl-config + + substituteInPlace src/audio.c \ + --replace "filename[64]" "filename[256]" + ''; + + buildInputs = [ SDL SDL_image SDL_mixer zlib ]; + + installPhase = '' + install -m 555 -D meritous $out/bin/meritous + mkdir -p $out/share/meritous + cp -r dat/* $out/share/meritous/ + ''; + + hardeningDisable = [ "stackprotector" "fortify" ]; + + meta = with lib; { + description = "Action-adventure dungeon crawl game"; + homepage = "https://gitlab.com/meritous/meritous"; + changelog = "https://gitlab.com/meritous/meritous/-/blob/master/NEWS"; + license = licenses.gpl3Only; + mainProgram = "meritous"; + maintainers = [ maintainers.alexvorobiev ]; + platforms = platforms.linux; + }; +}) diff --git a/nixpkgs/pkgs/by-name/me/mermaid-cli/package.nix b/nixpkgs/pkgs/by-name/me/mermaid-cli/package.nix new file mode 100644 index 000000000000..a45930287a50 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/mermaid-cli/package.nix @@ -0,0 +1,80 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchYarnDeps +, makeWrapper +, nodejs +, prefetch-yarn-deps +, yarn +, chromium +}: + +stdenv.mkDerivation rec { + pname = "mermaid-cli"; + version = "10.4.0"; + + src = fetchFromGitHub { + owner = "mermaid-js"; + repo = "mermaid-cli"; + rev = version; + hash = "sha256-mzBN/Hg/03+jYyoAHvjx33HC46ZA6dtHmiSnaExCRR0="; + }; + + offlineCache = fetchYarnDeps { + yarnLock = "${src}/yarn.lock"; + hash = "sha256-RQsRGzkuPgGVuEpF5lzv26XKMPLX2NrsjVkGMMkCbO4="; + }; + + nativeBuildInputs = [ + makeWrapper + nodejs + prefetch-yarn-deps + yarn + ]; + + configurePhase = '' + runHook preConfigure + + export HOME=$(mktemp -d) + yarn config --offline set yarn-offline-mirror "$offlineCache" + fixup-yarn-lock yarn.lock + yarn --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive install + patchShebangs node_modules + + runHook postConfigure + ''; + + buildPhase = '' + runHook preBuild + + yarn --offline prepare + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + yarn --offline --production install + + mkdir -p "$out/lib/node_modules/@mermaid-js/mermaid-cli" + cp -r . "$out/lib/node_modules/@mermaid-js/mermaid-cli" + + makeWrapper "${nodejs}/bin/node" "$out/bin/mmdc" \ + '' + lib.optionalString (lib.meta.availableOn stdenv.hostPlatform chromium) '' + --set PUPPETEER_EXECUTABLE_PATH '${lib.getExe chromium}' \ + '' + '' + --add-flags "$out/lib/node_modules/@mermaid-js/mermaid-cli/src/cli.js" + + runHook postInstall + ''; + + meta = { + description = "Generation of diagrams from text in a similar manner as markdown"; + homepage = "https://github.com/mermaid-js/mermaid-cli"; + license = lib.licenses.mit; + mainProgram = "mmdc"; + maintainers = with lib.maintainers; [ ysndr ]; + platforms = lib.platforms.all; + }; +} diff --git a/nixpkgs/pkgs/by-name/me/mescc-tools-extra/package.nix b/nixpkgs/pkgs/by-name/me/mescc-tools-extra/package.nix new file mode 100644 index 000000000000..892c185060e1 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/mescc-tools-extra/package.nix @@ -0,0 +1,40 @@ +{ lib +, stdenv +, fetchFromGitHub +, m2libc +, perl +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "mescc-tools-extra"; + version = "1.3.0"; + + src = fetchFromGitHub { + owner = "oriansj"; + repo = "mescc-tools-extra"; + rev = "Release_${finalAttrs.version}"; + hash = "sha256-LS9Eq1z+OsDF7Jq0TfF4u8jEJ5bjcLZNfKtnpIbtG20="; + }; + + # Don't use vendored M2libc + postPatch = '' + rmdir M2libc + ln -s ${m2libc}/include/M2libc M2libc + ''; + + enableParallelBuilding = true; + + doCheck = true; + checkTarget = "test"; + nativeCheckInputs = [ perl ]; + + installFlags = [ "PREFIX=$(out)" ]; + + meta = with lib; { + description = "Collection of tools written for use in bootstrapping"; + homepage = "https://github.com/oriansj/mescc-tools-extra"; + license = licenses.gpl3Only; + maintainers = teams.minimal-bootstrap.members; + inherit (m2libc.meta) platforms; + }; +}) diff --git a/nixpkgs/pkgs/by-name/me/mescc-tools/package.nix b/nixpkgs/pkgs/by-name/me/mescc-tools/package.nix new file mode 100644 index 000000000000..635e375aa80b --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/mescc-tools/package.nix @@ -0,0 +1,39 @@ +{ lib +, stdenv +, fetchFromSavannah +, m2libc +, which +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "mescc-tools"; + version = "1.5.1"; + + src = fetchFromSavannah { + repo = "mescc-tools"; + rev = "Release_${finalAttrs.version}"; + hash = "sha256-jFDrmzsjKEQKOKlsch1ceWtzUhoJAJVyHjXGVhjE9/U="; + }; + + # Don't use vendored M2libc + postPatch = '' + rmdir M2libc + ln -s ${m2libc}/include/M2libc M2libc + ''; + + enableParallelBuilding = true; + + doCheck = true; + checkTarget = "test"; + nativeCheckInputs = [ which ]; + + installFlags = [ "PREFIX=$(out)" ]; + + meta = with lib; { + description = "Collection of tools written for use in bootstrapping"; + homepage = "https://savannah.nongnu.org/projects/mescc-tools"; + license = licenses.gpl3Only; + maintainers = teams.minimal-bootstrap.members; + inherit (m2libc.meta) platforms; + }; +}) diff --git a/nixpkgs/pkgs/by-name/me/meson/001-fix-rpath.patch b/nixpkgs/pkgs/by-name/me/meson/001-fix-rpath.patch new file mode 100644 index 000000000000..29bec7903ca9 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/001-fix-rpath.patch @@ -0,0 +1,24 @@ +--- a/mesonbuild/backend/backends.py ++++ b/mesonbuild/backend/backends.py +@@ -723,6 +723,21 @@ + @staticmethod + def get_rpath_dirs_from_link_args(args: T.List[str]) -> T.Set[str]: + dirs: T.Set[str] = set() ++ ++ nix_ldflags = os.environ.get('NIX_LDFLAGS', '').split() ++ next_is_path = False ++ # Try to add rpaths set by user or ld-wrapper so that they are not removed. ++ # Based on https://github.com/NixOS/nixpkgs/blob/69711a2f5ffe8cda208163be5258266172ff527f/pkgs/build-support/bintools-wrapper/ld-wrapper.sh#L148-L177 ++ for flag in nix_ldflags: ++ if flag == '-rpath' or flag == '-L': ++ next_is_path = True ++ elif next_is_path or flag.startswith('-L/'): ++ if flag.startswith('-L/'): ++ flag = flag[2:] ++ if flag.startswith('@storeDir@'): ++ dirs.add(flag) ++ next_is_path = False ++ + # Match rpath formats: + # -Wl,-rpath= + # -Wl,-rpath, diff --git a/nixpkgs/pkgs/by-name/me/meson/002-clear-old-rpath.patch b/nixpkgs/pkgs/by-name/me/meson/002-clear-old-rpath.patch new file mode 100644 index 000000000000..f1e3c76e8b53 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/002-clear-old-rpath.patch @@ -0,0 +1,20 @@ +diff --git a/mesonbuild/scripts/depfixer.py b/mesonbuild/scripts/depfixer.py +index 4176b9a03..faaabf616 100644 +--- a/mesonbuild/scripts/depfixer.py ++++ b/mesonbuild/scripts/depfixer.py +@@ -336,6 +336,15 @@ class Elf(DataSizes): + if not new_rpath: + self.remove_rpath_entry(entrynum) + else: ++ # Clear old rpath to avoid stale references, ++ # not heeding the warning above about de-duplication ++ # since it does not seem to cause issues for us ++ # and not doing so trips up Nix’s reference checker. ++ # See https://github.com/NixOS/nixpkgs/pull/46020 ++ # and https://github.com/NixOS/nixpkgs/issues/95163 ++ self.bf.seek(rp_off) ++ self.bf.write(b'\0'*len(old_rpath)) ++ + self.bf.seek(rp_off) + self.bf.write(new_rpath) + self.bf.write(b'\0') diff --git a/nixpkgs/pkgs/by-name/me/meson/003-more-env-vars.patch b/nixpkgs/pkgs/by-name/me/meson/003-more-env-vars.patch new file mode 100644 index 000000000000..e4ad43550423 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/003-more-env-vars.patch @@ -0,0 +1,12 @@ +diff -Naur meson-0.60.2-old/mesonbuild/environment.py meson-0.60.2-new/mesonbuild/environment.py +--- meson-0.60.2-old/mesonbuild/environment.py 2021-11-02 16:58:13.000000000 -0300 ++++ meson-0.60.2-new/mesonbuild/environment.py 2021-12-12 17:44:00.350499307 -0300 +@@ -68,7 +68,7 @@ + # compiling we fall back on the unprefixed host version. This + # allows native builds to never need to worry about the 'BUILD_*' + # ones. +- ([var_name + '_FOR_BUILD'] if is_cross else [var_name]), ++ [var_name + '_FOR_BUILD'] + ([] if is_cross else [var_name]), + # Always just the unprefixed host versions + [var_name] + )[for_machine] diff --git a/nixpkgs/pkgs/by-name/me/meson/004-gir-fallback-path.patch b/nixpkgs/pkgs/by-name/me/meson/004-gir-fallback-path.patch new file mode 100644 index 000000000000..e6d740265277 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/004-gir-fallback-path.patch @@ -0,0 +1,21 @@ +diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py +index 1c6952df7..9466a0b7d 100644 +--- a/mesonbuild/modules/gnome.py ++++ b/mesonbuild/modules/gnome.py +@@ -923,6 +923,16 @@ class GnomeModule(ExtensionModule): + if fatal_warnings: + scan_command.append('--warn-error') + ++ if len(set(girtarget.get_custom_install_dir()[0] for girtarget in girtargets if girtarget.get_custom_install_dir())) > 1: ++ raise MesonException('generate_gir tries to build multiple libraries with different install_dir at once: {}'.format(','.join([str(girtarget) for girtarget in girtargets]))) ++ ++ if girtargets[0].get_custom_install_dir(): ++ fallback_libpath = girtargets[0].get_custom_install_dir()[0] ++ else: ++ fallback_libpath = None ++ if fallback_libpath is not None and isinstance(fallback_libpath, str) and len(fallback_libpath) > 0 and fallback_libpath[0] == "/": ++ scan_command += ['--fallback-library-path=' + fallback_libpath] ++ + generated_files = [f for f in libsources if isinstance(f, (GeneratedList, CustomTarget, CustomTargetIndex))] + + scan_target = self._make_gir_target(state, girfile, scan_command, generated_files, depends, kwargs) diff --git a/nixpkgs/pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch b/nixpkgs/pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch new file mode 100644 index 000000000000..0a2eda9de9ac --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/005-boost-Do-not-add-system-paths-on-nix.patch @@ -0,0 +1,21 @@ +diff -Naur meson-0.60.2-old/mesonbuild/dependencies/boost.py meson-0.60.2-new/mesonbuild/dependencies/boost.py +--- meson-0.60.2-old/mesonbuild/dependencies/boost.py 2021-11-02 16:58:07.000000000 -0300 ++++ meson-0.60.2-new/mesonbuild/dependencies/boost.py 2021-12-12 19:21:27.895705897 -0300 +@@ -682,16 +682,7 @@ + else: + tmp = [] # type: T.List[Path] + +- # Add some default system paths +- tmp += [Path('/opt/local')] +- tmp += [Path('/usr/local/opt/boost')] +- tmp += [Path('/usr/local')] +- tmp += [Path('/usr')] +- +- # Cleanup paths +- tmp = [x for x in tmp if x.is_dir()] +- tmp = [x.resolve() for x in tmp] +- roots += tmp ++ # Remove such spurious, non-explicit "system" paths for Nix&Nixpkgs + + self.check_and_set_roots(roots, use_system=True) + diff --git a/nixpkgs/pkgs/by-name/me/meson/006-disable-bitcode.patch b/nixpkgs/pkgs/by-name/me/meson/006-disable-bitcode.patch new file mode 100644 index 000000000000..a72997c10439 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/006-disable-bitcode.patch @@ -0,0 +1,24 @@ +--- a/mesonbuild/compilers/mixins/clang.py ++++ b/mesonbuild/compilers/mixins/clang.py +@@ -56,10 +56,6 @@ class ClangCompiler(GnuLikeCompiler): + {OptionKey('b_colorout'), OptionKey('b_lto_threads'), OptionKey('b_lto_mode'), OptionKey('b_thinlto_cache'), + OptionKey('b_thinlto_cache_dir')}) + +- # TODO: this really should be part of the linker base_options, but +- # linkers don't have base_options. +- if isinstance(self.linker, AppleDynamicLinker): +- self.base_options.add(OptionKey('b_bitcode')) + # All Clang backends can also do LLVM IR + self.can_compile_suffixes.add('ll') + +--- a/mesonbuild/linkers/linkers.py ++++ b/mesonbuild/linkers/linkers.py +@@ -785,7 +785,7 @@ class AppleDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): + return self._apply_prefix('-headerpad_max_install_names') + + def bitcode_args(self) -> T.List[str]: +- return self._apply_prefix('-bitcode_bundle') ++ raise MesonException('Nixpkgs cctools does not support bitcode bundles') + + def fatal_warnings(self) -> T.List[str]: + return self._apply_prefix('-fatal_warnings') diff --git a/nixpkgs/pkgs/by-name/me/meson/emulator-hook.sh b/nixpkgs/pkgs/by-name/me/meson/emulator-hook.sh new file mode 100644 index 000000000000..4f08087cf5f5 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/emulator-hook.sh @@ -0,0 +1,5 @@ +add_meson_exe_wrapper_cross_flag() { + mesonFlagsArray+=(--cross-file=@crossFile@) +} + +preConfigureHooks+=(add_meson_exe_wrapper_cross_flag) diff --git a/nixpkgs/pkgs/by-name/me/meson/package.nix b/nixpkgs/pkgs/by-name/me/meson/package.nix new file mode 100644 index 000000000000..4bf3a3a7d551 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/package.nix @@ -0,0 +1,158 @@ +{ lib +, stdenv +, fetchFromGitHub +, installShellFiles +, coreutils +, darwin +, libxcrypt +, openldap +, ninja +, pkg-config +, python3 +, substituteAll +, zlib +}: + +let + inherit (darwin.apple_sdk.frameworks) AppKit Cocoa Foundation LDAP OpenGL; +in +python3.pkgs.buildPythonApplication rec { + pname = "meson"; + version = "1.3.2"; + + src = fetchFromGitHub { + owner = "mesonbuild"; + repo = "meson"; + rev = "refs/tags/${version}"; + hash = "sha256-7M/El2snWsQi+gaZWPHnEr9gpJW3trqG1RbnT43M49s="; + }; + + patches = [ + # In typical distributions, RPATH is only needed for internal libraries so + # meson removes everything else. With Nix, the locations of libraries + # are not as predictable, therefore we need to keep them in the RPATH. + # At the moment we are keeping the paths starting with /nix/store. + # https://github.com/NixOS/nixpkgs/issues/31222#issuecomment-365811634 + (substituteAll { + src = ./001-fix-rpath.patch; + inherit (builtins) storeDir; + }) + + # When Meson removes build_rpath from DT_RUNPATH entry, it just writes + # the shorter NUL-terminated new rpath over the old one to reduce + # the risk of potentially breaking the ELF files. + # But this can cause much bigger problem for Nix as it can produce + # cut-in-half-by-\0 store path references. + # Let’s just clear the whole rpath and hope for the best. + ./002-clear-old-rpath.patch + + # Meson is currently inspecting fewer variables than autoconf does, which + # makes it harder for us to use setup hooks, etc. + # https://github.com/mesonbuild/meson/pull/6827 + ./003-more-env-vars.patch + + # Unlike libtool, vanilla Meson does not pass any information about the path + # library will be installed to to g-ir-scanner, breaking the GIR when path + # other than ${!outputLib}/lib is used. + # We patch Meson to add a --fallback-library-path argument with library + # install_dir to g-ir-scanner. + ./004-gir-fallback-path.patch + + # Patch out default boost search paths to avoid impure builds on + # unsandboxed non-NixOS builds, see: + # https://github.com/NixOS/nixpkgs/issues/86131#issuecomment-711051774 + ./005-boost-Do-not-add-system-paths-on-nix.patch + + # Nixpkgs cctools does not have bitcode support. + ./006-disable-bitcode.patch + ]; + + buildInputs = lib.optionals (python3.pythonOlder "3.9") [ + libxcrypt + ]; + + nativeBuildInputs = [ installShellFiles ]; + + nativeCheckInputs = [ + ninja + pkg-config + ]; + + checkInputs = [ + zlib + ] + ++ lib.optionals stdenv.isDarwin [ + AppKit + Cocoa + Foundation + LDAP + OpenGL + openldap + ]; + + checkPhase = lib.concatStringsSep "\n" ([ + "runHook preCheck" + '' + patchShebangs 'test cases' + substituteInPlace \ + 'test cases/native/8 external program shebang parsing/script.int.in' \ + --replace /usr/bin/env ${coreutils}/bin/env + '' + ] + # Remove problematic tests + ++ (builtins.map (f: ''rm -vr "${f}";'') [ + # requires git, creating cyclic dependency + ''test cases/common/66 vcstag'' + # requires glib, creating cyclic dependency + ''test cases/linuxlike/6 subdir include order'' + ''test cases/linuxlike/9 compiler checks with dependencies'' + # requires static zlib, see #66461 + ''test cases/linuxlike/14 static dynamic linkage'' + # Nixpkgs cctools does not have bitcode support. + ''test cases/osx/7 bitcode'' + ]) + ++ [ + ''HOME="$TMPDIR" python ./run_project_tests.py'' + "runHook postCheck" + ]); + + postInstall = '' + installShellCompletion --zsh data/shell-completions/zsh/_meson + installShellCompletion --bash data/shell-completions/bash/meson + ''; + + postFixup = '' + pushd $out/bin + # undo shell wrapper as meson tools are called with python + for i in *; do + mv ".$i-wrapped" "$i" + done + popd + + # Do not propagate Python + rm $out/nix-support/propagated-build-inputs + + substituteInPlace "$out/share/bash-completion/completions/meson" \ + --replace "python3 -c " "${python3.interpreter} -c " + ''; + + setupHook = ./setup-hook.sh; + + meta = { + homepage = "https://mesonbuild.com"; + description = "An open source, fast and friendly build system made in Python"; + longDescription = '' + Meson is an open source build system meant to be both extremely fast, and, + even more importantly, as user friendly as possible. + + The main design point of Meson is that every moment a developer spends + writing or debugging build definitions is a second wasted. So is every + second spent waiting for the build system to actually start compiling + code. + ''; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ AndersonTorres ]; + inherit (python3.meta) platforms; + }; +} +# TODO: a more Nixpkgs-tailoired test suite diff --git a/nixpkgs/pkgs/by-name/me/meson/setup-hook.sh b/nixpkgs/pkgs/by-name/me/meson/setup-hook.sh new file mode 100644 index 000000000000..85849fbec734 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/meson/setup-hook.sh @@ -0,0 +1,87 @@ +# shellcheck shell=bash disable=SC2206 + +mesonConfigurePhase() { + runHook preConfigure + + local flagsArray=() + + if [ -z "${dontAddPrefix-}" ]; then + flagsArray+=("--prefix=$prefix") + fi + + # See multiple-outputs.sh and meson’s coredata.py + flagsArray+=( + "--libdir=${!outputLib}/lib" + "--libexecdir=${!outputLib}/libexec" + "--bindir=${!outputBin}/bin" + "--sbindir=${!outputBin}/sbin" + "--includedir=${!outputInclude}/include" + "--mandir=${!outputMan}/share/man" + "--infodir=${!outputInfo}/share/info" + "--localedir=${!outputLib}/share/locale" + "-Dauto_features=${mesonAutoFeatures:-enabled}" + "-Dwrap_mode=${mesonWrapMode:-nodownload}" + ${crossMesonFlags} + "--buildtype=${mesonBuildType:-plain}" + ) + + flagsArray+=( + $mesonFlags + "${mesonFlagsArray[@]}" + ) + + echoCmd 'mesonConfigurePhase flags' "${flagsArray[@]}" + + meson setup build "${flagsArray[@]}" + cd build || { echoCmd 'mesonConfigurePhase' "could not cd to build"; exit 1; } + + if ! [[ -v enableParallelBuilding ]]; then + enableParallelBuilding=1 + echoCmd 'mesonConfigurePhase' "enabled parallel building" + fi + + if [[ ${checkPhase-ninjaCheckPhase} = ninjaCheckPhase && -z $dontUseMesonCheck ]]; then + checkPhase=mesonCheckPhase + fi + if [[ ${installPhase-ninjaInstallPhase} = ninjaInstallPhase && -z $dontUseMesonInstall ]]; then + installPhase=mesonInstallPhase + fi + + runHook postConfigure +} + +mesonCheckPhase() { + runHook preCheck + + local flagsArray=($mesonCheckFlags "${mesonCheckFlagsArray[@]}") + + echoCmd 'mesonCheckPhase flags' "${flagsArray[@]}" + meson test --no-rebuild "${flagsArray[@]}" + + runHook postCheck +} + +mesonInstallPhase() { + runHook preInstall + + local flagsArray=() + + if [[ -n "$mesonInstallTags" ]]; then + flagsArray+=("--tags" "${mesonInstallTags// /,}") + fi + flagsArray+=( + $mesonInstallFlags + "${mesonInstallFlagsArray[@]}" + ) + + echoCmd 'mesonInstallPhase flags' "${flagsArray[@]}" + meson install --no-rebuild "${flagsArray[@]}" + + runHook postInstall +} + +if [ -z "${dontUseMesonConfigure-}" ] && [ -z "${configurePhase-}" ]; then + # shellcheck disable=SC2034 + setOutputFlags= + configurePhase=mesonConfigurePhase +fi diff --git a/nixpkgs/pkgs/by-name/me/mev-boost/package.nix b/nixpkgs/pkgs/by-name/me/mev-boost/package.nix new file mode 100644 index 000000000000..6a7bb6d1e4a4 --- /dev/null +++ b/nixpkgs/pkgs/by-name/me/mev-boost/package.nix @@ -0,0 +1,27 @@ +{ lib +, stdenv +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "mev-boost"; + version = "1.6"; + src = fetchFromGitHub { + owner = "flashbots"; + repo = "mev-boost"; + rev = "v${version}"; + hash = "sha256-vzgX9irpI5i85bohppyL5KWQuf71SryRu1gkhWSCVKk="; + }; + + vendorHash = "sha256-xw3xVbgKUIDXu4UQD5CGftON8E4o1u2FcrPo3n6APBE="; + + meta = with lib; { + description = "Ethereum block-building middleware"; + homepage = "https://github.com/flashbots/mev-boost"; + license = licenses.mit; + mainProgram = "mev-boost"; + maintainers = with maintainers; [ ekimber ]; + platforms = platforms.unix; + }; +} |