Skip to content

Commit

Permalink
Merge pull request #4 from katrinafyi/update
Browse files Browse the repository at this point in the history
flake.lock: Update to 2024-05-21
  • Loading branch information
katrinafyi authored Jul 3, 2024
2 parents 4284c45 + d00308b commit b79e7a8
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 64 deletions.
2 changes: 1 addition & 1 deletion bap/bap-asli-plugin.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
sha256 = "sha256-CsdUjXHHVisfiTP2XGOHfm+Aa23KZep4IdgoYHQsnXg=";
};

buildInputs = [ bap asli findlib ];
buildInputs = [ asli bap findlib ];
nativeBuildInputs = [ ocaml ];
dontDetectOcamlConflicts = true;

Expand Down
38 changes: 4 additions & 34 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
nixConfig.extra-substituters = [ "https://pac-nix.cachix.org/" ];
nixConfig.extra-trusted-public-keys = [ "pac-nix.cachix.org-1:l29Pc2zYR5yZyfSzk1v17uEZkhEw0gI4cXuOIsxIGpc=" ];

inputs.nixpkgs-upstream.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.nixpkgs.url = "github:katrinafyi/nixpkgs/pac-nix";

inputs.nixpkgs-patch-1.url = "https://github.com/NixOS/nixpkgs/compare/ffacc011dffba16ca360028d1f81cae99ff1280f..9a9cf8661391f21f7a44dc4823f815524351c94f.patch";
inputs.nixpkgs-patch-1.flake = false;
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
# inputs.nixpkgs-upstream.url = "github:nixos/nixpkgs/nixos-unstable";
# inputs.nixpkgs.url = "github:katrinafyi/nixpkgs/pac-nix";

outputs = { self, nixpkgs, ... }:
let
Expand Down
2 changes: 1 addition & 1 deletion llvm-translator/alive2-aslp.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ alive2-regehr.overrideAttrs (prev: {
};

cmakeFlags = prev.cmakeFlags
++ [ (lib.cmakeFeature "ANTLR4_JAR_LOCATION" antlr.jarLocation) ];
++ [ (lib.cmakeFeature "ANTLR4_JAR_LOCATION" "${antlr.jarLocation}") ];

})
25 changes: 13 additions & 12 deletions llvm-translator/ocaml-llvm.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
{ lib
, fetchFromGitHub
, buildDunePackage
, llvmPackages
, libllvm
, ctypes
, ctypes-foreign
, zlib
, libxml2
, ncurses
}:

let libllvm = llvmPackages.libllvm;
in buildDunePackage rec {
buildDunePackage rec {
pname = "llvm";
version = "14.0.6";
version = libllvm.version;

nativeBuildInputs = [ libllvm ];
# nativeBuildInputs = [ libllvm ];

duneSrc = fetchFromGitHub {
owner = "alan-j-hu";
repo = "llvm-dune";
rev = "v${version}";
hash = "sha256-GHxncfthpMTeVdlDhe7shKWJvoa8Ctn5tU4AfOyOS2w=";
hash =
lib.throwIfNot (version == "14.0.6") "ocaml-llvm libllvm mismatch"
"sha256-GHxncfthpMTeVdlDhe7shKWJvoa8Ctn5tU4AfOyOS2w=";
fetchSubmodules = false;
};

llvmSrc = lib.throwIfNot (libllvm.version == version)
"ocaml-llvm: versions must match (got: ${libllvm.version}, ${version})"
libllvm.src;
llvmSrc = libllvm.src;

srcs = [ duneSrc llvmSrc ];
sourceRoot = "source";

buildInputs = [ zlib libxml2 ctypes ncurses ];
buildInputs = [ zlib libxml2 ncurses ];
propagatedBuildInputs = [ ctypes ctypes-foreign ];

prePatch = ''
rm -rf llvm-project
Expand All @@ -41,8 +42,8 @@ in buildDunePackage rec {
runHook preConfigure
substituteInPlace setup.sh \
--replace "cp " "cp --no-preserve=mode,ownership " \
--replace support_static_mode=true support_static_mode=false
--replace "cp " "cp --no-preserve=mode,ownership "
# --replace support_static_mode=true support_static_mode=false
./setup.sh ${libllvm.dev}/bin/llvm-config
Expand Down
9 changes: 4 additions & 5 deletions llvm-translator/remill.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ in
stdenv.mkDerivation (self:
{
pname = "remill";
version = "unstable-2023-09-27";
version = "unstable-2024-05-12";

src = fetchFromGitHub {
owner = "lifting-bits";
repo = "remill";
# sparc working but llvm 17: 391261923a036196ad9dd2c8213c0193ad727cd9
rev = "7182636a687e5e005e3336108a653de3aec0362b";
hash = "sha256-4oeHmgkXJlBsLyK359XbfI4Xfq/hRcxqaIA2hsK2piI=";
rev = "1c9b5a0b26fbfe6c1e78426bbce7003763f27d9e";
hash = "sha256-OkagldvILOvKehldBlJkRRo7c1AcT3IeeSfrUHOi78g=";
};

GIT_RETRIEVED_STATE = true;
Expand Down Expand Up @@ -136,7 +135,7 @@ stdenv.mkDerivation (self:
"-DDVCPKG_TARGET_TRIPLET=x64-linux-rel"
"-DGIT_EXECUTABLE=${git-am-shim}"
# "-DFETCHCONTENT_QUIET=OFF"
"-DREMILL_BUILD_SPARC32_RUNTIME=False"
# "-DREMILL_BUILD_SPARC32_RUNTIME=False"
];

})
22 changes: 16 additions & 6 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ let

update = prev.callPackage ./update.nix { };

# ocamlPackages_pac = final.ocamlPackages.overrideScope final.overlay_ocamlPackages
# // { _overlay = final.overlay_ocamlPackages; };
ocamlPackages_pac = final.ocaml-ng.ocamlPackages_4_14.overrideScope final.overlay_ocamlPackages
// { _overlay = final.overlay_ocamlPackages; };
# ocamlPackages_pac_4_09 = final.ocaml-ng.ocamlPackages_4_09.overrideScope final.overlay_ocamlPackages
# // { _overlay = final.overlay_ocamlPackages; };

# llvm-translator packages
overlay_ocamlPackages = ofinal: oprev: {
llvm = ofinal.callPackage ./llvm-translator/ocaml-llvm.nix { llvmPackages = final.llvmPackages_14; };
asl-translator = ofinal.callPackage ./llvm-translator/asl-translator.nix { };
ocaml-llvm-14 = ofinal.callPackage ./llvm-translator/ocaml-llvm.nix { libllvm = final.llvmPackages_14.libllvm; };
asl-translator = ofinal.callPackage ./llvm-translator/asl-translator.nix { llvm = ofinal.ocaml-llvm-14; };
};
inherit (final.ocamlPackages_pac) asl-translator;

retdec5 = prev.callPackage ./llvm-translator/retdec5.nix { };
retdec-uq-pac = prev.callPackage ./llvm-translator/retdec-uq-pac.nix { retdec = final.retdec5; };

llvm-custom-15 = prev.callPackage ./llvm-translator/llvm-custom.nix { llvmPackages = final.llvmPackages_15; };
llvm-custom-git = prev.callPackage ./llvm-translator/llvm-custom.nix { llvmPackages = final.llvmPackages_git; };
llvm-custom-git = prev.callPackage ./llvm-translator/llvm-custom.nix { llvmPackages = final.llvmPackages_18; };

alive2 = prev.callPackage ./llvm-translator/alive2.nix {
llvmPackages = final.llvm-custom-15;
Expand All @@ -30,7 +31,16 @@ let
llvmPackages = final.llvm-custom-git;
};
alive2-aslp = prev.callPackage ./llvm-translator/alive2-aslp.nix { };
remill = prev.callPackage ./llvm-translator/remill.nix { };
xed2022 = prev.xed.overrideAttrs rec {
version = "2022.08.11";
src = prev.fetchFromGitHub {
owner = "intelxed";
repo = "xed";
rev = "v${version}";
sha256 = "sha256-Iil+dfjuWYPbzmSjgwKTKScSE/IsWuHEKQ5HsBJDqWM=";
};
};
remill = prev.callPackage ./llvm-translator/remill.nix { xed = final.xed2022; };
sleigh = prev.callPackage ./llvm-translator/sleigh.nix { };

_overlay = overlay;
Expand Down

0 comments on commit b79e7a8

Please sign in to comment.