generated from aleksrutins/reason-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow building with a custom derivation
- Loading branch information
1 parent
7ce29dc
commit 08f3058
Showing
8 changed files
with
221 additions
and
12 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
description = "A custom plan example for Packsnap"; | ||
|
||
inputs.packsnap.url = "../.."; | ||
inputs.flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
outputs = { self, nixpkgs, flake-utils, packsnap }: flake-utils.lib.eachDefaultSystem (system: | ||
let pkgs = (import nixpkgs) { inherit system; }; | ||
in { | ||
packages.packsnap-custom-plan = packsnap.lib.${system}.buildCustomPlan { | ||
name = "packsnap-custom-plan"; | ||
contents = [ | ||
(pkgs.stdenv.mkDerivation { | ||
name = "packsnap-custom-plan"; | ||
inherit system; | ||
|
||
src = ./.; | ||
nativeBuildInputs = [ | ||
pkgs.gcc | ||
pkgs.pkg-config | ||
pkgs.meson | ||
pkgs.ninja | ||
]; | ||
}) | ||
]; | ||
start = "packsnap-custom-plan"; | ||
}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <stdio.h> | ||
|
||
#define PROJECT_NAME "packsnap-custom-plan" | ||
|
||
int main(int argc, char **argv) { | ||
if(argc != 1) { | ||
printf("%s takes no arguments.\n", argv[0]); | ||
return 1; | ||
} | ||
puts("Hello, Packsnap from C!"); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
project('custom-plan', 'c', | ||
version : '0.1', | ||
default_options : ['warning_level=3']) | ||
|
||
exe = executable('packsnap-custom-plan', 'main.c', | ||
install : true) | ||
|
||
test('basic', exe) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters