Skip to content

Commit f45342c

Browse files
Fix IntelDFP to not require Git
Don't BuildRequires git, and just use 'patch' on the IntelDFP sources if possible. (cherry picked from commit 76e08d8)
1 parent 033035c commit f45342c

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

.evergreen/config.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,6 +845,10 @@ tasks:
845845
content_type: '${content_type|application/x-gzip}'
846846

847847
- name: debian-package-build
848+
run_on: &deb-package-build-run_on
849+
- ubuntu2004
850+
- ubuntu2004-small
851+
tags: [packaging]
848852
commands:
849853
- func: "fetch source"
850854
- command: shell.exec
@@ -868,6 +872,8 @@ tasks:
868872
display_name: "deb.tar.gz"
869873

870874
- name: debian-package-build-i386
875+
run_on: *deb-package-build-run_on
876+
tags: [packaging]
871877
commands:
872878
- func: "fetch source"
873879
- command: shell.exec
@@ -1369,10 +1375,7 @@ buildvariants:
13691375
- "publish-java"
13701376
- name: packaging
13711377
display_name: "Linux Distro Packaging"
1372-
run_on: ubuntu2004-small
1373-
tasks:
1374-
- name: debian-package-build
1375-
- name: debian-package-build-i386
1378+
tasks: [.packaging]
13761379
- name: macos
13771380
display_name: macOS m1 (Apple LLVM)
13781381
run_on: macos-1100-arm64

cmake/IntelDFP.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
include (FetchContent)
33
find_program (GIT_EXECUTABLE git)
4+
find_program (PATCH_EXECUTABLE patch)
45

56
set (_default_url "${PROJECT_SOURCE_DIR}/third-party/IntelRDFPMathLib20U2.tar.xz")
67

@@ -18,9 +19,13 @@ if (NOT INTEL_DFP_LIBRARY_URL_SHA256 STREQUAL "no-verify")
1819
endif ()
1920

2021
# Make the PATCH_COMMAND a no-op if it was disabled
21-
set (_patch_disabler)
22+
set (patch_command)
2223
if (NOT INTEL_DFP_LIBRARY_PATCH_ENABLED)
23-
set (_patch_disabler "${CMAKE_COMMAND}" -E true)
24+
set (patch_command "${CMAKE_COMMAND}" -E true)
25+
elseif (GIT_EXECUTABLE)
26+
set (patch_command "${GIT_EXECUTABLE}" --work-tree=<SOURCE_DIR> apply)
27+
else ()
28+
set (patch_command "${PATCH_EXECUTABLE}" --dir=<SOURCE_DIR>)
2429
endif ()
2530

2631
# NOTE: The applying of the patch expects the correct input directly from the
@@ -33,8 +38,7 @@ FetchContent_Declare (
3338
URL "${_default_url}"
3439
${_hash_arg}
3540
PATCH_COMMAND
36-
${_patch_disabler}
37-
"${GIT_EXECUTABLE}" --work-tree=<SOURCE_DIR> apply
41+
${patch_command}
3842
-p 4 # Strip four path components
3943
"${PROJECT_SOURCE_DIR}/etc/mongo-inteldfp-s390x.patch"
4044
--verbose

etc/rpm/tweak.awk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
# Replace the autosetup with one that copies the source tree into place
1212
/%autosetup/ {
13-
print "cd %{_topdir}/BUILD\n" \
14-
"cp -rf %{_sourcedir}/. $PWD\n" \
13+
print "cp -rf %{_sourcedir}/. %{_builddir}/\n" \
1514
"%autopatch 0 -p1"
1615
next
1716
}

0 commit comments

Comments
 (0)