Skip to content
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

Fix issue #3646 #3864

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ phoenix.pro.user
/phoenix-build-*
/release*
/build*
/config.tests/build*
/debug*
*.user
*.user*
Expand Down
8 changes: 6 additions & 2 deletions phoenix.pro
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,12 @@ equals(QT_MAJOR_VERSION, 6) {
RC_FILE = fritzing.rc
RESOURCES += phoenixresources.qrc

# Disable this if you have (and want) libgit2 dynamically
LIBGIT_STATIC = true
# If you have installed libgit2 (dynamic version)
# pass the LIBGIT_STATIC variable to qmake during building:
# $ qmake LIBGIT_STATIC=false
# If you do not pass the variable, it will automatically set
# to true.
!defined(LIBGIT_STATIC, var): LIBGIT_STATIC = true
include(pri/libgit2detect.pri)
include(pri/boostdetect.pri)
include(pri/spicedetect.pri)
Expand Down
38 changes: 36 additions & 2 deletions pri/libgit2detect.pri
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# along with Fritzing. If not, see <http://www.gnu.org/licenses/>.
# ********************************************************************


packagesExist(libgit2) {
} else {
LIBGIT_STATIC = true
Expand Down Expand Up @@ -51,6 +50,9 @@ win32 {
}

unix {
# Look up Ubuntu distribution (codename)
LSB_INFO = $$system(lsb_release -sc 2> /dev/null)

if ($$LIBGIT_STATIC) {
LIBGIT2LIB = $$_PRO_FILE_PWD_/../libgit2/build
exists($$LIBGIT2LIB/libgit2.a) {
Expand All @@ -61,7 +63,39 @@ unix {
macx {
LIBS += $$LIBGIT2LIB/libgit2.a -framework Security
} else {
LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto
# Ubuntu Bionic
if(contains(LSB_INFO, bionic)) {
message("we are on Ubuntu bionic.")
# Check if the http_parser library is installed
exists($$[QT_INSTALL_LIBS]/libhttp_parser.a) {
message("Using system-wide installed http-parser lib.")
LIBS += $$LIBGIT2LIB/libgit2.a -lhttp_parser -lssl -lcrypto
} else {
message("Using http-parser bundled with libgit2.")
LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto
}
# Ubuntu Focal
} else:contains(LSB_INFO, focal) {
message("we are on Ubuntu focal.")
# Check if the http_parser library is installed
exists($$[QT_INSTALL_LIBS]/libhttp_parser.a) {
message("Using system-wide installed http-parser lib.")
LIBS += $$LIBGIT2LIB/libgit2.a -lhttp_parser -lssh2 -lssl -lcrypto
} else {
message("Using http-parser bundled with libgit2.")
LIBS += $$LIBGIT2LIB/libgit2.a -lssh2 -lssl -lcrypto
}
# Other Linux OS (tested on Fedora-30)
} else {
message("we are neither on Ubuntu focal nor on Ubuntu bionic.")
exists($$[QT_INSTALL_LIBS]/libhttp_parser.a) {
message("Using system-wide installed http-parser lib.")
LIBS += $$LIBGIT2LIB/libgit2.a -lhttp_parser -lssl -lcrypto
} else {
message("Using http-parser bundled with libgit2.")
LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto
}
}
}
} else {
!build_pass:warning("Using dynamic linking for libgit2.")
Expand Down