nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 89 lines 2.6 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchpatch, 6 replaceVars, 7 tradcpp, 8 xorg-cf-files, 9 pkg-config, 10 xorgproto, 11 writeScript, 12}: 13stdenv.mkDerivation (finalAttrs: { 14 pname = "imake"; 15 version = "1.0.11"; 16 17 src = fetchurl { 18 url = "mirror://xorg/individual/util/imake-${finalAttrs.version}.tar.xz"; 19 hash = "sha256-VZVVJ+rr6UYz5Ag9T+XyFgpl/kxtr97ki4n+pfHKing="; 20 }; 21 22 patches = [ 23 # Disable imake autodetection for: 24 # - LinuxDistribution to avoid injection of /usr paths 25 # - gcc to avoid use uf /usr/bin/gcc 26 # https://github.com/NixOS/nixpkgs/issues/135337 27 ./disable-autodetection.patch 28 # uberhack to workaround broken 'gcc -x c' 29 # 30 # Our cc-wrapper is broken whenever the '-x' flag is used: 31 # 'gcc -x c foo.c -o bar' doesn't work the same way as 'gcc foo.c -o bar' 32 # does. (Try both with NIX_DEBUG=1.) 33 # 34 # What happens is that passing '-x' causes linker-related flags (such as 35 # -Wl,-dynamic-linker) not to be added, just like if '-c' is passed. 36 # The bug happens outside the multiple-outputs branch as well, but it 37 # doesn't break imake there. It only breaks in multiple-outputs because 38 # linking without -Wl,-dynamic-linker produces a binary with an invalid 39 # ELF interpreter path. (Which arguably, is a bug in its own.) 40 # (copied from the commit message on 0100b270694ecab8aaa13fa5f3d30639b50d7777) 41 ./cc-wrapper-uberhack.patch 42 ]; 43 44 strictDeps = true; 45 46 nativeBuildInputs = [ pkg-config ]; 47 48 buildInputs = [ xorgproto ]; 49 50 configureFlags = [ 51 "ac_cv_path_RAWCPP=${stdenv.cc.targetPrefix}cpp" 52 ]; 53 54 env.CFLAGS = "-DIMAKE_COMPILETIME_CPP='\"${ 55 if stdenv.hostPlatform.isDarwin then "${tradcpp}/bin/cpp" else "gcc" 56 }\"'"; 57 58 preInstall = '' 59 mkdir -p $out/lib/X11/config 60 ln -s ${xorg-cf-files}/lib/X11/config/* $out/lib/X11/config 61 ''; 62 63 setupHook = replaceVars ./setup-hook.sh { 64 inherit tradcpp; 65 }; 66 67 passthru = { 68 updateScript = writeScript "update-${finalAttrs.pname}" '' 69 #!/usr/bin/env nix-shell 70 #!nix-shell -i bash -p common-updater-scripts 71 version="$(list-directory-versions --pname ${finalAttrs.pname} \ 72 --url https://xorg.freedesktop.org/releases/individual/util/ \ 73 | sort -V | tail -n1)" 74 update-source-version ${finalAttrs.pname} "$version" 75 ''; 76 }; 77 78 meta = { 79 description = "Obsolete C preprocessor interface to the make utility"; 80 homepage = "https://gitlab.freedesktop.org/xorg/util/imake"; 81 license = with lib.licenses; [ 82 mitOpenGroup 83 x11 84 ]; 85 mainProgram = "imake"; 86 maintainers = [ ]; 87 platforms = lib.platforms.unix; 88 }; 89})