From patchwork Sat May 23 19:21:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabrice Fontaine X-Patchwork-Id: 1296766 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=u4z3tdt4; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49TtVP754tz9sPK for ; Sun, 24 May 2020 05:20:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3525385955; Sat, 23 May 2020 19:20:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 42g_ufVorYt6; Sat, 23 May 2020 19:20:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 607E7858A6; Sat, 23 May 2020 19:20:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 0F36C1BF31D for ; Sat, 23 May 2020 19:20:26 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0BB9987928 for ; Sat, 23 May 2020 19:20:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fJWLHRGpGs-p for ; Sat, 23 May 2020 19:20:24 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 79EE687862 for ; Sat, 23 May 2020 19:20:24 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id j198so299098wmj.0 for ; Sat, 23 May 2020 12:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mts972afwRzRp6BMx4S+Z8KutyeN5B0pYNYCI/ktZgM=; b=u4z3tdt4+3V8v0vcqmZ+5sHG0fP1lTkilAZW4AG8HggHOJMQNJmqccOrGAIeQXGuq/ AAx1b4IGTlUwEmyD2CdK27CKE3LVZ4zAwYU993LTNodOVs+1MSOdgCH0o1xudpv7EQha E+AGEAECTo0MmMwwHef3p6YBfOsZuhuF0EbVOBrqqJYdQ/8EFApTEitL1acNpwzoowqs 2bXsL01F4DkQqpkB+Nn3hjcGwvwNni0AaRLFGu7OCD0svKw4xnv757eUYTavqT3AtPqL wS0zFI7iQTkTQTCF9biFRmNCO0HdB+V4slGQHBIkectwqlLE/6a2bIFllnChG0jblulP co7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mts972afwRzRp6BMx4S+Z8KutyeN5B0pYNYCI/ktZgM=; b=Fuiia2SxZ2lZWmWjj1Rr82bmjLXWtBT2Iu1lUW+IYjDZJP1OzlMhGgUEjn7yXH2SLE QyRLtBjvV3qv9kSdOChhCCsNnubq7uUqQcYnwEMpv4RSwsmA4tT89mvGDpk8/xYtoHcU 6X0DsCR9usUU0OxAl8fW/jCaycxj1ayj+5B0TjhBLiK5yrnFGGsAUp2U3FUvT5Q3nCzk qbZLtCVA1P7leyxqrhbNHYhdpSgVeybymS4NuTWQbIGZv6A+xoMBtA7ATkcWfsLGYi8t p1PDs6pxZ9HpF+gFu00Lok5ZLKbc/+GDCjZTm0S7ISJ9xRn6MF5ql8eHoTpWZ4UDBiio e5zA== X-Gm-Message-State: AOAM530Zsm6FZ3nim57qz9mBUpLA7b98Ue3vEc+aJt7ay7SSTnMq4WcJ cPC/MOlNIyHMWpGZISUwVGk79mco X-Google-Smtp-Source: ABdhPJzxB8ZeAnzNW8OMl4aKs2RNVGOek/t/zCIrOQZsKHYiah7Iw5P9nFXz6JHXLNKJjM4Bi5MFsw== X-Received: by 2002:a1c:1f0d:: with SMTP id f13mr17151265wmf.184.1590261622472; Sat, 23 May 2020 12:20:22 -0700 (PDT) Received: from kali.home (lfbn-ren-1-2144-158.w92-167.abo.wanadoo.fr. [92.167.223.158]) by smtp.gmail.com with ESMTPSA id h15sm7985634wrt.73.2020.05.23.12.20.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 May 2020 12:20:21 -0700 (PDT) From: Fabrice Fontaine To: buildroot@buildroot.org Date: Sat, 23 May 2020 21:21:55 +0200 Message-Id: <20200523192155.1216456-1-fontaine.fabrice@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/gerbera: fix static linking with libmagic X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch was wrongly removed when bumping the version to 1.4.0 in commit 6976f312fa84d4a9c4bbf99ed3b173085780dcd9 Fixes: - http://autobuild.buildroot.org/results/7a53a59dd08c043f371bea967c3b450a7bddcde8 Signed-off-by: Fabrice Fontaine --- ...indLibMagic-cmake-fix-static-linking.patch | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 package/gerbera/0002-cmake-FindLibMagic-cmake-fix-static-linking.patch diff --git a/package/gerbera/0002-cmake-FindLibMagic-cmake-fix-static-linking.patch b/package/gerbera/0002-cmake-FindLibMagic-cmake-fix-static-linking.patch new file mode 100644 index 0000000000..f6cc276e70 --- /dev/null +++ b/package/gerbera/0002-cmake-FindLibMagic-cmake-fix-static-linking.patch @@ -0,0 +1,63 @@ +From 7fdcabd80c823694d190e5baa8c657ffcae5e777 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Fri, 31 Jan 2020 17:14:11 +0100 +Subject: [PATCH] cmake/FindLibMagic.cmake: fix static linking + +libmagic can optionally depends on xz (for lzma) or bzip2 since version +5.38 and +https://github.com/file/file/commit/b259a07ea95827f565faa20f0316e5b2704064f7 +so use pkg-config to retrieve those static dependencies and avoid the +following build failure: + +[100%] Linking CXX executable gerbera +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: /home/br-user/autobuild/run/instance-0/output-1/host/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libmagic.a(compress.o): in function `uncompressbuf': +compress.c:(.text+0x69c): undefined reference to `BZ2_bzDecompressInit' +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: compress.c:(.text+0x710): undefined reference to `BZ2_bzDecompress' +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: compress.c:(.text+0x730): undefined reference to `BZ2_bzDecompressEnd' +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: compress.c:(.text+0x7bc): undefined reference to `lzma_auto_decoder' +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: compress.c:(.text+0x828): undefined reference to `lzma_code' +/home/br-user/autobuild/run/instance-0/output-1/host/opt/ext-toolchain/bin/../lib/gcc/arm-buildroot-linux-uclibcgnueabi/8.3.0/../../../../arm-buildroot-linux-uclibcgnueabi/bin/ld: compress.c:(.text+0x848): undefined reference to `lzma_end' + +It should be noted that libmagic.pc is not currently provided in the +official file package (which provides libmagic), an issue has been +opened to add libmagic.pc: https://bugs.astron.com/view.php?id=136 + +Fixes: + - http://autobuild.buildroot.org/results/37b1ef54dc41100689f311fbc31fc9300dc6ae63 + +Signed-off-by: Fabrice Fontaine +[Retrieved from: +https://github.com/gerbera/gerbera/commit/7fdcabd80c823694d190e5baa8c657ffcae5e777] +--- + cmake/FindLibMagic.cmake | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/cmake/FindLibMagic.cmake b/cmake/FindLibMagic.cmake +index f68ab923..04995af4 100644 +--- a/cmake/FindLibMagic.cmake ++++ b/cmake/FindLibMagic.cmake +@@ -1,11 +1,22 @@ + INCLUDE (FindPackageHandleStandardArgs) + +-FIND_PATH(MAGIC_INCLUDE_DIR magic.h) +-FIND_LIBRARY(MAGIC_LIBRARIES NAMES magic) ++find_package(PkgConfig QUIET) ++ ++pkg_check_modules(PC_MAGIC QUIET libmagic) ++ ++FIND_PATH(MAGIC_INCLUDE_DIR magic.h ++ HINTS ${PC_MAGIC_INCLUDEDIR} ${PC_MAGIC_INCLUDE_DIRS}) ++FIND_LIBRARY(MAGIC_LIBRARIES NAMES magic ++ HINTS ${PC_MAGIC_LIBDIR} ${PC_MAGIC_LIBRARY_DIRS}) + + # handle the QUIETLY and REQUIRED arguments and set MAGIC_FOUND to TRUE + find_package_handle_standard_args(MAGIC DEFAULT_MSG MAGIC_LIBRARIES) + ++if (MAGIC_FOUND) ++ set (MAGIC_LIBRARIES ${MAGIC_LIBRARY} ${PC_MAGIC_LIBRARIES}) ++ set (MAGIC_INCLUDE_DIRS ${MAGIC_INCLUDE_DIR} ) ++endif () ++ + MARK_AS_ADVANCED( + MAGIC_LIBRARIES + MAGIC_INCLUDE_DIRS )