X-Original-To: alpine-devel@mail.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail.alpinelinux.org (dallas-a1.alpinelinux.org [127.0.0.1]) by mail.alpinelinux.org (Postfix) with ESMTP id 7878EDC0740 for ; Fri, 8 May 2015 22:26:36 +0000 (UTC) Received: from mail-pd0-f172.google.com (mail-pd0-f172.google.com [209.85.192.172]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 4B5F2DC06E0 for ; Fri, 8 May 2015 22:26:31 +0000 (UTC) Received: by pdea3 with SMTP id a3so100001894pde.3 for ; Fri, 08 May 2015 15:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=FTQktaaLnh8secQjVv9JBzYbsTk+AIR6kwHHEx6i4qk=; b=Kbfh8CXD+hE57Q9Md+W8ijtGYPQQzJZJ61jOxQaDjluBj63zCO27u8vuvE60gljUXt LAeirG8o82uOQN2u8W+ZShIwZRwGKlHS0a2OlrgYKtS2hR6Pl3n1cdQbufOf2ABAQn3d W58HfA0FbLEv5kY5CLTKvM9c+Q3anKSMWeA8KFi+VK/f4W75nEFs2iIPbYAEK06c8LQe w2PHh65o07tT98A666Ux3FKAuEFjSjd0RyRsvdHaK31CGBnAhG/dbVodHWwL2RZcc2GM Wr72fGkLmF9rRG468rL/SFJAHTuebmvMlXLO3pq2oh8ESztqxgjHU6VpkngSOPlofU/y dtOg== X-Received: by 10.66.192.74 with SMTP id he10mr245953pac.145.1431123990122; Fri, 08 May 2015 15:26:30 -0700 (PDT) Received: from newbook ([50.0.225.244]) by mx.google.com with ESMTPSA id k4sm6181205pdk.7.2015.05.08.15.26.29 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 08 May 2015 15:26:29 -0700 (PDT) Date: Fri, 8 May 2015 15:26:36 -0700 From: Isaac Dunham To: alpine-devel@lists.alpinelinux.org Subject: [alpine-devel] Re: [PATCH] newapkbuild: add CMake support. Message-ID: <20150508222632.GA1856@newbook> References: <1427855404-5412-1-git-send-email-ibid.ag@gmail.com> X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427855404-5412-1-git-send-email-ibid.ag@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Virus-Scanned: ClamAV using ClamSMTP On Tue, Mar 31, 2015 at 07:30:04PM -0700, Isaac Dunham wrote: > This is a first try that *might* work for cross-compiling packages with > an absolute bare minimum of requirements, if you're lucky. > I can't debug that part further, but the references should help with it. Ping. While I can't test cross-compiling, I can tell that the cmake APKBUILDs that are in common use are far short of what we need for cross-compiling. Thanks, Isaac Dunham > --- > newapkbuild.in | 32 ++++++++++++++++++++++++++++++++ > 1 file changed, 32 insertions(+) > > diff --git a/newapkbuild.in b/newapkbuild.in > index 952980f..d2951e4 100644 > --- a/newapkbuild.in > +++ b/newapkbuild.in > @@ -52,6 +52,34 @@ build_autotools() { > __EOF__ > } > > +build_cmake() { > +# References: > +# http://www.cmake.org/Wiki/CMake_Useful_Variables > +# http://www.vtk.org/Wiki/CMake_Cross_Compiling > +# This is incomplete: CMAKE_{HOST_,}SYSTEM_PROCESSOR needs to be set, > +# and likewise CMAKE_FIND_ROOT_PATH and a few other details. > + > + sed -i -e 's/^\(makedepends="\)/\1cmake /' APKBUILD > + cat >>APKBUILD<<__EOF__ > + if [ "$CBUILD" != "$CHOST" ] > + then > + CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux" > + fi > + cmake \\ > + -DCMAKE_INSTALL_PREFIX=/usr \\ > + -DCMAKE_INSTALL_LIBDIR=lib \\ > + -DBUILD_SHARED_LIBS=True \\ > + -DCMAKE_BUILD_TYPE=Release \\ > + -DCMAKE_CXX_COMPILER="\${CXX:-g++}" \\ > + -DCMAKE_C_COMPILER="\${CC:-gcc}" \\ > + -DCMAKE_CXX_FLAGS="\$CXXFLAGS" \\ > + -DCMAKE_CXX_FLAGS="\$CFLAGS" \\ > + ${CMAKE_CROSSOPTS} \\ > + || return 1 > + make || return 1 > +__EOF__ > +} > + > build_perl() { > cat >>APKBUILD<<__EOF__ > PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor || return 1 > @@ -224,6 +252,8 @@ __EOF__ > case "$buildtype" in > make) > build_make;; > + cmake) > + build_cmake;; > autotools) > build_autotools;; > perl) > @@ -281,6 +311,7 @@ Options: > -l Set package license to LICENSE > -u Set package URL > -a Create autotools (use ./configure ...) > + -C Create CMake pakckage (Assume cmake/ is there) > -p Create perl package (Assume Makefile.PL is there) > -y Create python package (Assume setup.py is there) > -s Use sourceforge source URL > @@ -295,6 +326,7 @@ while getopts "acd:fhl:n:pyu:s" opt; do > case $opt in > 'a') buildtype="autotools";; > 'c') cpinitd=1;; > + 'C') buildtype="cmake";; > 'd') pkgdesc="$OPTARG";; > 'f') force=1;; > 'h') usage; exit;; > -- > 2.3.4 > --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---