Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Requires `libsqlite-dev` and `libcurl4-gnutls-dev`, both compiled against `glibc
./gradlew linuxX64DistZip
```

If you are on a system with a different glibc, try to use nix and build phoenixd inside the shell that you can create with the command `nix-shell .nix/shell.nix`.

### Native MacOS x64
```shell
./gradlew macosX64DistZip
Expand All @@ -31,4 +33,4 @@ Requires `libsqlite-dev` and `libcurl4-gnutls-dev`, both compiled against `glibc
### JVM
```shell
./gradlew distZip
```
```
68 changes: 68 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
description = "Server equivalent of the popular Phoenix wallet";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ ];
};

# Importing glibc 2.19 for compiling the recent version of curl
pkgs-glibc = import
(builtins.fetchTarball {
url = "https://github.com/NixOS/nixpkgs/archive/b6f505c60a2417d4fad4dc5245754e4e33eb4d40.tar.gz";
sha256 = "sha256:0hhb8sar8qxi179d6c5h6n8f7nm71xxqqbynjv8pldvpsmsxxzh9";
})
{ inherit system; };
in
{
packages = {
default = pkgs.gnumake;
};
formatter = pkgs.nixpkgs-fmt;

devShell = pkgs.mkShellNoCC {
buildInputs = with pkgs; [
# build dependencies
git
pkg-config
zlib
wget

sqlite
jdk
gradle
kotlin

# Ok this should help you lean a few things
# See https://github.com/ACINQ/phoenixd/issues/1#issuecomment-2018205685
(pkgs.stdenv.mkDerivation {
name = "curl-7.87.0";
src = pkgs.fetchurl {
url = "https://curl.se/download/curl-7.87.0.tar.bz2";
sha256 = "sha256-XW4Sh2G3EQlG0Sdq/28PJm8rcm9eYZ9+CgV6R0FV8wc=";
};
buildInputs = [ pkgs.zlib pkgs.openssl.dev ];
configureFlags = [ "--with-zlib=${pkgs.zlib}" "--with-openssl=${pkgs.openssl.dev}" ];
})

ncurses
] ++ [
pkgs-glibc.glibc
];

shellHook = ''
# FIXME: this need to go in a build task
gradle linuxX64DistZip
'';
};
}
);
}