From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Re: How to ship native modules? Date: Tue, 21 Feb 2017 13:12:56 +0800 Message-ID: References: <874lzoqh94.fsf@luca> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e3490d6f6c40549036e22 X-Trace: blaine.gmane.org 1487654016 8642 195.159.176.226 (21 Feb 2017 05:13:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 21 Feb 2017 05:13:36 +0000 (UTC) Cc: emacs-devel To: Andreas Politz Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Feb 21 06:13:31 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 1cg2lT-0001NY-4n for ged-emacs-devel@m.gmane.org; Tue, 21 Feb 2017 06:13:27 +0100 Original-Received: from localhost ([::1]:42376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg2lX-0002MW-FF for ged-emacs-devel@m.gmane.org; Tue, 21 Feb 2017 00:13:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41436) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cg2l0-0002MR-Jt for emacs-devel@gnu.org; Tue, 21 Feb 2017 00:12:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cg2kz-00054I-FM for emacs-devel@gnu.org; Tue, 21 Feb 2017 00:12:58 -0500 Original-Received: from mail-vk0-x232.google.com ([2607:f8b0:400c:c05::232]:36587) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cg2kz-00054E-9f for emacs-devel@gnu.org; Tue, 21 Feb 2017 00:12:57 -0500 Original-Received: by mail-vk0-x232.google.com with SMTP id t8so73288405vke.3 for ; Mon, 20 Feb 2017 21:12:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OabfXsJl+znsewnl0k5iJ9siFZugXQR3ko9NZcyxD8c=; b=gRuA8dmuxjtafy238myB6EWU0HvU2E8Spsq3Wi0kLkSZ82tihdDkyhE0bfbtG4M6nu yESrTQD8ZuyLB5mct1Z2kgefBbRFAHY1Rdle6K8O5rtnD02UBwXkH3PRdUcp4lVGHco8 eOcJHbQUW6zQIonphLybofNN4jykJeTuc/y0wllz8yCyIAdxIjrEaTHAvZtDXz4VHmJr MPjgDuLHCyA+2YXfe0Q4DrmaUsbgv3dSlvBCHH+XUzo+l/Pcg/xHgkmdDRFbeGyQaYf2 ia/Y18VYkd8uUAVeAPafRqHObyJOardT/yGWEy63qdnL6LgVnmtNDeG9PbM5+E0aPcvo RGOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OabfXsJl+znsewnl0k5iJ9siFZugXQR3ko9NZcyxD8c=; b=ci0YCWh/G1BWbo35CvTBOKO3HIeaJ8O0qCsrEwM9811U2qH9FKocgzmRWNy2WkSedf evar2qbtdUNCTYserCXRpRyXxpCSsZ5otWBS+Ffyqdm7be/r59zWqZ6DBZS+Fg7mv8Ga klm445kmEHmfAO1Omah6wIRlG979lufc+ES5KvXRRJpNi7ESwxThQzAIs2HJ7NuU13WC SBn0tFS0ZnSKUj6hVDlnOT+7lz4bRCMafDVa8sUKHSLwozwsXzHX9ogUMjLGCvmU0itH +stF32geVM0TR9xuMS7Jm8GV75H4o00kdvfdoEXE+sHGnxz6ebouYfnYPbZA8WX8/5jy VZwg== X-Gm-Message-State: AMke39lM7Ooecz4+8vq8YD9ZFgwsoaPKWC/17M3LWAcwy2J6zl12jRQEMF0OxZAc1yREGPWMw1HN5yWkVn95Tg== X-Received: by 10.31.94.204 with SMTP id s195mr12037420vkb.76.1487653976861; Mon, 20 Feb 2017 21:12:56 -0800 (PST) Original-Received: by 10.103.119.5 with HTTP; Mon, 20 Feb 2017 21:12:56 -0800 (PST) In-Reply-To: <874lzoqh94.fsf@luca> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400c:c05::232 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:212517 Archived-At: --001a114e3490d6f6c40549036e22 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 21 February 2017 at 12:50, Andreas Politz wrote: > 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 use pdf-tools, and I have definitely seen the same issue there. > 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. > Indeed. The MIT and Heimdal implementations also have some minor differences that has to be taken into account, making the Makefile more complex. > 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). > I don't use OSX much anymore, so I wasn't aware of that. > 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 ? > I think that sounds like a great idea. If you build a prototype I'd be happy to provide whatever assistance I can. Regards, Elias --001a114e3490d6f6c40549036e22 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 1 February 2017 at 12:50, Andreas Politz <politza@hochschule-tri= er.de> wrote:
Elias M=C3=A5rtenson <lokedhs= @gmail.com> 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. Essentia= lly
> 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 t= he
same, problem.

I use pdf-tools, and I h= ave definitely seen the same issue there.
=C2=A0
I think your analogy to autoconf is not the right one.= =C2=A0 What's needed is
more like an abstraction over the various systems including package
manager and possibly naming schemes.=C2=A0 For example on Arch you need to<= br> 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.

Indeed. The= MIT and Heimdal implementations also have some minor differences that has = to be taken into account, making the Makefile more complex.
=C2= =A0
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).

I don&= #39;t use OSX much anymore, so I wasn't aware of that.
=C2=A0=
This could be implemented in a neat, s= mall 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 ?

I think that sounds= like a great idea. If you build a prototype I'd be happy to provide wh= atever assistance I can.

Regards,
Elias= =C2=A0
--001a114e3490d6f6c40549036e22--