From cd37425ddf2b404b382be59d4e5f4541f05b7d53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=9D=84=EF=B8=8F?= <5861043+superherointj@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:02:40 -0300 Subject: [PATCH] odin: refactor, enable aarch64-linux --- pkgs/development/compilers/odin/default.nix | 44 +++++++++++---------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/odin/default.nix b/pkgs/development/compilers/odin/default.nix index 6b381f308b55..f8081cba3440 100644 --- a/pkgs/development/compilers/odin/default.nix +++ b/pkgs/development/compilers/odin/default.nix @@ -1,9 +1,10 @@ -{ lib -, fetchFromGitHub -, llvmPackages -, makeBinaryWrapper +{ fetchFromGitHub +, lib , libiconv +, llvmPackages , MacOSX-SDK +, makeBinaryWrapper +, nix-update-script , Security , which }: @@ -21,17 +22,6 @@ in stdenv.mkDerivation rec { hash = "sha256-FeiVTLwgP0x1EZqqiYkGbKALhZWC4xE6a/3PPcEElAc="; }; - nativeBuildInputs = [ - makeBinaryWrapper which - ]; - - buildInputs = lib.optionals stdenv.isDarwin [ - libiconv - Security - ]; - - LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config"; - postPatch = lib.optionalString stdenv.isDarwin '' substituteInPlace src/linker.cpp \ --replace-fail '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' ${MacOSX-SDK} @@ -41,12 +31,23 @@ in stdenv.mkDerivation rec { patchShebangs build_odin.sh ''; + LLVM_CONFIG = "${llvmPackages.llvm.dev}/bin/llvm-config"; + dontConfigure = true; buildFlags = [ "release" ]; + nativeBuildInputs = [ + makeBinaryWrapper which + ]; + + buildInputs = lib.optionals stdenv.isDarwin [ + libiconv + Security + ]; + installPhase = '' runHook preInstall @@ -70,12 +71,15 @@ in stdenv.mkDerivation rec { runHook postInstall ''; - meta = with lib; { + passthru.updateScript = nix-update-script {}; + + meta = { description = "Fast, concise, readable, pragmatic and open sourced programming language"; - mainProgram = "odin"; + downloadPage = "https://github.com/odin-lang/Odin"; homepage = "https://odin-lang.org/"; - license = licenses.bsd3; - maintainers = with maintainers; [ luc65r astavie znaniye ]; - platforms = platforms.x86_64 ++ [ "aarch64-darwin" ]; + license = lib.licenses.bsd3; + mainProgram = "odin"; + maintainers = with lib.maintainers; [ astavie luc65r znaniye ]; + platforms = lib.platforms.unix; }; }