-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p4: 2021.2.2201121 -> 2022.1.2305383, build from source and remove unfree binaries #190105
Conversation
CCFLAGS = | ||
# Appears to be missing from upstream distribution, but is in fact | ||
# open-source redistributable software. | ||
lib.optionals stdenv.isAarch64 [ "-I${./aarch64/zlib/include}" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we pull this from somewhere instead of keeping it in nixpkgs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
It means that it is possible to catch |
Hmm, I suppose in theory you could implement a |
Well, that was unexpected. |
Oh! Ha. Sorry for the misunderstanding! Yes, that's certainly possible, and there's actually even a Edit: If you have the
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
++ lib.optionals stdenv.isLinux [ "-sOSVER=26" ] | ||
++ lib.optionals stdenv.isDarwin [ "-sOSVER=1013" ]; | ||
|
||
outputs = [ "bin" "dev" "out" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outputs = [ "bin" "dev" "out" ]; | |
outputs = [ "out" "bin" "dev" ]; |
otherwise leftover files end up in bin
CROSS_COMPILE = stdenv.cc.targetPrefix; | ||
CCFLAGS = | ||
# The file contrib/optimizations/slide_hash_neon.h is missing from the | ||
# upstream distribution. It comes from the Android/Chromium sources. | ||
lib.optionals stdenv.isAarch64 [ "-I${androidZlibContrib}" ]; | ||
"C++FLAGS" = | ||
# Avoid a compilation error that only occurs for 4-byte longs. | ||
lib.optionals stdenv.isi686 [ "-Wno-narrowing" ] | ||
# See the "Header dependency changes" section of | ||
# https://www.gnu.org/software/gcc/gcc-11/porting_to.html for more information | ||
# on why we need to include these. | ||
++ lib.optionals | ||
(stdenv.cc.isClang || (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.cc.version "11.0.0")) | ||
[ "-include" "limits" "-include" "thread" ]; | ||
MALLOC_OVERRIDE = "no"; | ||
SSLINCDIR = "${lib.getDev opensslStatic}/include"; | ||
SSLLIBDIR = "${lib.getLib opensslStatic}/lib"; | ||
MACOSX_SDK = lib.optionalString stdenv.isDarwin "${emptyDirectory}"; | ||
"LIBC++DIR" = lib.optionalString stdenv.isDarwin "${libcxxUnified}/lib"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Those should be exportet in some prePhase like preBuild
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are all actually flags to jam
, so I'm just going to move them into there. The way I have them split out right now doesn't really make any sense I don't think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved all of them except CCFLAGS and C++FLAGS which are Jam's standard equivalent to the autotools/make convention of CFLAGS and CXXFLAGS, respectively, so they felt like they could stay at the top level. Since they're built from a list of conditionals it's also harder to put them inside a preBuild
-style script that maintains readability.
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Foundation Security ]; | ||
nativeBuildInputs = [ jam ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Foundation Security ]; | |
nativeBuildInputs = [ jam ]; | |
nativeBuildInputs = [ jam ]; | |
buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Foundation Security ]; |
# actually https://cdist2.perforce.com/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz but upstream deletes releases | ||
url = "https://web.archive.org/web/20211118024943/https://cdist2.perforce.com/perforce/r21.2/bin.linux26x86_64/helix-core-server.tgz"; | ||
sha256 = "sha256-SrfI2ZD7KDyttCd8+fo8g4UZKljYYO/SbzqrS9tAcC8="; | ||
# Upstream replaces minor versions, so use cached URL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Upstream replaces minor versions, so use cached URL. | |
# Upstream replaces minor versions, so use cached URL. |
# Upstream replaces minor versions, so use cached URL. | |
# Upstream replaces minor versions, so use archived URL. |
paths = [ libcxx libcxxabi ]; | ||
}; | ||
|
||
version = "2022.1.2305383"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is that moved here? It is unused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used further down to determine the path of the p4api
directory, so I can call mkDerivation
without using rec
. If using rec
is OK with you I can of course just put it directly in there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using rec is totally fine.
97064c5
to
8a56bcb
Compare
The actual p4 command is open-source software released under the 2-clause BSD license, so we can build it here (for pretty much every architecture we support!) and include it in the cache. This change removes the server-side commands from this package, but they are now available as part of a separate p4d package instead. (The server package remains unfree.) As an added bonus, we can also include the libraries and headers for the C/C++ API, which will allow us to package any software that uses Perforce as a library in the future.
@SuperSandro2000 Thank you for the detailed review! I think I addressed everything, but please let me know if there are any other changes you'd like to see. |
Description of changes
The actual p4 command is open-source software released under the 2-clause BSD license, so we can build it here (for pretty much every architecture we support!) and include it in the cache.
This change removes the server-side commands from this package, but they are now available as part of a separate p4d package (#190100) instead. (The server package remains unfree, and to make users' lives easier its PR should probably be merged before this one.)
As an added bonus, we can also include the libraries and headers for the C/C++ API, which will allow us to package any software that uses Perforce as a library in the future.
Please note that I am employed by Perforce but I am not currently supporting these packages in an official capacity.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes