forked from NixOS/nixpkgs
-
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.
objfw: move passthru test to its own file
- Loading branch information
1 parent
8a32455
commit e8c6769
Showing
2 changed files
with
45 additions
and
38 deletions.
There are no files selected for viewing
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
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,44 @@ | ||
{ | ||
clangStdenv, | ||
objfw, | ||
writeTextDir, | ||
}: | ||
|
||
clangStdenv.mkDerivation { | ||
name = "ObjFW test"; | ||
buildInputs = [ objfw ]; | ||
|
||
src = writeTextDir "helloworld.m" '' | ||
#import <ObjFW/ObjFW.h> | ||
int main() { | ||
OFLog(@"Hello world from objc"); | ||
return 0; | ||
} | ||
''; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
clang -o testbinary \ | ||
-x objective-c -Xclang \ | ||
-fobjc-runtime=objfw \ | ||
-funwind-tables \ | ||
-fconstant-string-class=OFConstantString \ | ||
-Xclang -fno-constant-cfstrings \ | ||
helloworld.m \ | ||
-lobjfw -lobjfwrt | ||
runHook postBuild | ||
''; | ||
|
||
checkPhase = '' | ||
runHook preCheck | ||
./testbinary | ||
runHook postCheck | ||
''; | ||
doCheck = true; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
touch $out | ||
runHook postInstall | ||
''; | ||
} |