roc: init at alpha3 (#387308)

authored by Ben Siraphob and committed by GitHub 7b7e9324 79591f08

+128
+15
maintainers/maintainer-list.nix
··· 1787 githubId = 301546; 1788 name = "Antoine Roy-Gobeil"; 1789 }; 1790 anton-dessiatov = { 1791 email = "anton.dessiatov@gmail.com"; 1792 github = "anton-dessiatov"; ··· 3270 github = "bhankas"; 3271 githubId = 24254289; 3272 name = "Payas Relekar"; 3273 }; 3274 bhasherbel = { 3275 email = "nixos.maintainer@bhasher.com"; ··· 21981 github = "rtburns-jpl"; 21982 githubId = 47790121; 21983 name = "Ryan Burns"; 21984 }; 21985 rtimush = { 21986 email = "rtimush@gmail.com";
··· 1787 githubId = 301546; 1788 name = "Antoine Roy-Gobeil"; 1789 }; 1790 + anton-4 = { 1791 + name = "Anton"; 1792 + github = "Anton-4"; 1793 + githubId = 17049058; 1794 + }; 1795 anton-dessiatov = { 1796 email = "anton.dessiatov@gmail.com"; 1797 github = "anton-dessiatov"; ··· 3275 github = "bhankas"; 3276 githubId = 24254289; 3277 name = "Payas Relekar"; 3278 + }; 3279 + bhansconnect = { 3280 + github = "bhansconnect"; 3281 + githubId = 8334696; 3282 + name = "Brendan Hansknecht"; 3283 }; 3284 bhasherbel = { 3285 email = "nixos.maintainer@bhasher.com"; ··· 21991 github = "rtburns-jpl"; 21992 githubId = 47790121; 21993 name = "Ryan Burns"; 21994 + }; 21995 + rtfeldman = { 21996 + github = "rtfeldman"; 21997 + githubId = 1094080; 21998 + name = "Richard Feldman"; 21999 }; 22000 rtimush = { 22001 email = "rtimush@gmail.com";
+113
pkgs/by-name/ro/roc/package.nix
···
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + libffi, 6 + libxml2, 7 + makeBinaryWrapper, 8 + cmake, 9 + glibc, 10 + rustPlatform, 11 + zig_0_13, 12 + llvmPackages_18, 13 + writableTmpDirAsHomeHook, 14 + valgrind, 15 + autoPatchelfHook, 16 + }: 17 + 18 + let 19 + llvmPackages = llvmPackages_18; 20 + rocVersion = "alpha3"; 21 + in 22 + 23 + rustPlatform.buildRustPackage rec { 24 + pname = "roc"; 25 + version = "0-${rocVersion}"; 26 + 27 + src = fetchFromGitHub { 28 + owner = "roc-lang"; 29 + repo = "roc"; 30 + rev = "9a0238e0f34c09e27e3ca89e8fc5a684a21bf456"; 31 + hash = "sha256-iM16DlTf+1yXBZVH7QqzhKuSkn1n/ZDosnZj3t+io0E="; 32 + }; 33 + 34 + nativeBuildInputs = 35 + [ 36 + cmake 37 + zig_0_13 38 + ] 39 + ++ lib.optionals stdenv.isLinux [ 40 + autoPatchelfHook 41 + ]; 42 + 43 + buildInputs = 44 + [ 45 + libffi 46 + libxml2 47 + llvmPackages.clang 48 + llvmPackages.llvm.dev 49 + makeBinaryWrapper 50 + ] 51 + ++ lib.optionals stdenv.isLinux [ 52 + glibc 53 + stdenv.cc.cc.lib 54 + ]; 55 + 56 + useFetchCargoVendor = true; 57 + cargoHash = "sha256-9cOJ79GrnrMEIhFikvCfXa2SI4O0fy50cr4Fb6p4Vho="; 58 + 59 + # prevents zig AccessDenied error github.com/ziglang/zig/issues/6810 60 + XDG_CACHE_HOME = "xdg_cache"; 61 + 62 + preBuild = 63 + let 64 + llvmVersion = builtins.splitVersion llvmPackages.release_version; 65 + llvmMajorMinorStr = builtins.elemAt llvmVersion 0 + "0"; 66 + in 67 + '' 68 + export LLVM_SYS_${llvmMajorMinorStr}_PREFIX=${llvmPackages.llvm.dev} 69 + ''; 70 + 71 + postInstall = 72 + lib.optionalString stdenv.isLinux '' 73 + wrapProgram $out/bin/roc \ 74 + --set NIX_GLIBC_PATH ${glibc.out}/lib \ 75 + --set NIX_LIBGCC_S_PATH ${stdenv.cc.cc.lib}/lib \ 76 + --prefix PATH : ${lib.makeBinPath [ stdenv.cc ]} 77 + '' 78 + + lib.optionalString (!stdenv.isLinux) '' 79 + wrapProgram $out/bin/roc --prefix PATH : ${lib.makeBinPath [ stdenv.cc ]} 80 + ''; 81 + 82 + nativeCheckInputs = [ 83 + writableTmpDirAsHomeHook 84 + llvmPackages.clang 85 + valgrind 86 + ]; 87 + 88 + checkPhase = 89 + lib.optionalString stdenv.isLinux '' 90 + runHook preCheck 91 + NIX_GLIBC_PATH=${glibc.out}/lib NIX_LIBGCC_S_PATH=${stdenv.cc.cc.lib}/lib cargo test --release --workspace --exclude test_mono --exclude uitest -- --skip glue_cli_tests 92 + runHook postCheck 93 + '' 94 + + lib.optionalString (!stdenv.isLinux) '' 95 + runHook preCheck 96 + cargo test --release --workspace --exclude test_mono --exclude uitest -- --skip glue_cli_tests 97 + runHook postCheck 98 + ''; 99 + 100 + meta = { 101 + description = "Fast, friendly, functional programming language"; 102 + mainProgram = "roc"; 103 + homepage = "https://www.roc-lang.org/"; 104 + changelog = "https://github.com/roc-lang/roc/releases/tag/${rocVersion}"; 105 + license = lib.licenses.upl; 106 + maintainers = [ 107 + lib.maintainers.anton-4 108 + lib.maintainers.bhansconnect 109 + lib.maintainers.rtfeldman 110 + ]; 111 + platforms = [ "x86_64-linux" ]; 112 + }; 113 + }