Skip to content

Commit f455cd6

Browse files
authored
Merge pull request #11 from replit/th-flake
Add flake file
2 parents 1c55c2f + 32fda26 commit f455cd6

3 files changed

Lines changed: 61 additions & 2 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.PHONY: all
2-
all: rtld_loader.so test
2+
all: rtld_loader.so
33

44
.PHONY: test
55
test: binsearch_lookup_test.bin string_funs_test.bin env_parser_test.bin dynamic_lookup_test.bin rtld_loader.so
@@ -13,7 +13,7 @@ rtld_loader.so: $(shell find src -type f) src/lookup_by_channel.generated.c
1313
gcc -shared -nostdlib -fno-stack-protector -fPIC -O2 src/*.c -o rtld_loader.so
1414

1515
src/lookup_by_channel.generated.c: scripts/gen_lookup_by_channel.py $(shell find registry -type f)
16-
scripts/gen_lookup_by_channel.py
16+
python scripts/gen_lookup_by_channel.py
1717

1818
binsearch_lookup_test.bin: test/binsearch_lookup_test.c src/string_funs.[ch] src/binsearch_lookup.[ch]
1919
gcc $^ -g -o $@ -I src

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
description = "The Replit RTLD Loader allows dynamically loaded shared libraries (.so) to work seamlessly in Repls";
3+
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
4+
5+
outputs = { self, nixpkgs, ... }:
6+
let pkgs = import nixpkgs {
7+
system = "x86_64-linux";
8+
};
9+
package = pkgs.stdenv.mkDerivation {
10+
pname = "replit_rtld_loader";
11+
version = "1";
12+
src = ./.;
13+
buildInputs = [pkgs.python310];
14+
installPhase = ''
15+
mkdir $out
16+
mv rtld_loader.so $out/
17+
'';
18+
};
19+
in
20+
{
21+
packages.x86_64-linux.default = package;
22+
devShells.x86_64-linux.default = pkgs.mkShell {
23+
packages = with pkgs; [
24+
python310
25+
gnumake
26+
];
27+
};
28+
overlays.default = final: prev: {
29+
replit-rtld-loader = package;
30+
};
31+
};
32+
}

0 commit comments

Comments
 (0)