From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.devel Subject: Re: How to ship native modules? Date: Tue, 21 Feb 2017 05:50:47 +0100 Message-ID: <874lzoqh94.fsf@luca> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1487652722 23226 195.159.176.226 (21 Feb 2017 04:52:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2017 04:52:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: emacs-devel To: Elias =?utf-8?Q?M=C3=A5rtenson?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 21 05:51:56 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cg2Qa-000515-0l for ged-emacs-devel@m.gmane.org; Tue, 21 Feb 2017 05:51:52 +0100 Original-Received: from localhost ([::1]:42312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg2Qd-0004Pz-RH for ged-emacs-devel@m.gmane.org; Mon, 20 Feb 2017 23:51:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37497) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg2Pr-0004On-Mq for emacs-devel@gnu.org; Mon, 20 Feb 2017 23:51:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg2Po-0006dN-JU for emacs-devel@gnu.org; Mon, 20 Feb 2017 23:51:07 -0500 Original-Received: from gateway-a.fh-trier.de ([143.93.54.181]:57667) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cg2Po-0006cq-9A for emacs-devel@gnu.org; Mon, 20 Feb 2017 23:51:04 -0500 X-Virus-Scanned: by Amavisd-new + McAfee uvscan + ClamAV [Rechenzentrum Hochschule Trier (RZ/HT)] Original-Received: from localhost (ip5f5bdeea.dynamic.kabel-deutschland.de [95.91.222.234]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: politza) by gateway-a.fh-trier.de (Postfix) with ESMTPSA id 23812179ADE6; Tue, 21 Feb 2017 05:50:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=hochschule-trier.de; s=default; t=1487652648; bh=/bDpgdV+OK0Aa/+WlDZS29Wg3Xw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type:Content-Transfer-Encoding; b=LRYsOJGGcaDpz0TTT+1zEk5j7hj36vuJjdvS2xOwlrN/6Q310D7IB9aw+r5q+tJAd wBUmbZnYfXzxZD8P7jmG7ftWB+B4JQDYbtr88qcQ7wGwDkwzD+c1HEQAA+f7DVLnM/ DVND7XSRdMbB1a8m0Nc0eWl8J2os1T3JgEGqODeA= In-Reply-To: ("Elias =?utf-8?Q?M=C3=A5rtenson=22's?= message of "Mon, 20 Feb 2017 18:00:24 +0800") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 143.93.54.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:212515 Archived-At: Elias M=C3=A5rtenson writes: > If it is to be shipped as part of ELPA, then a different question > emerges: Should I simply add code to the Elisp files that checks if it > can find the native library and if not, compile it on the fly? It's > doable, but I'd hard to reinvent several wheels to do so. Essentially > I'd have to rebuild part of autoconf in Elisp. Hi, I am the author of pdf-tools and I have a very similar, if not the same, problem. I think your analogy to autoconf is not the right one. What's needed is more like an abstraction over the various systems including package manager and possibly naming schemes. For example on Arch you need to install the package krb5 with pacman, while on Debian its probably libkrb5-dev and libkrb5 using aptitude and on Windows you'd download some installer or whatever. There are various other details to consider. For example make is called gmake on BSD, or you need to setup an environment variable (e.g. PKG_CONFIG_PATH on macos). This could be implemented in a neat, small package, your package depends on and calls into as part of the installation or first-time-running process. Adding a new system-configuration should be fairly easy. I've been pondering to write such a thing, what do you think ? -ap