Re: Newbie user: Feedback on custom package definition

2023-03-02 Thread (
On Thu Mar 2, 2023 at 6:54 PM GMT, Vagrant Cascadian wrote:
> I often wonder if the name "trivial-build-system" should not be
> something more like:
>
>   diy-get-your-hands-messy-with-a-lot-of-effort-build-system

Maybe PRIMITIVE-BUILD-SYSTEM?

-- (


signature.asc
Description: PGP signature


Re: Icecat and ungoogled chromium in a container

2023-03-02 Thread Wojtek Kosior via
> Hi,
> 
> thank you.
> 
> I downloaded this file with wget.
> 
> But how can I now use it? What do I have to do?
> 
> Is it only for icecat? or can I use it also for chromium?
> 
> Kind regards
> 
> Gottfried

It seems the file Arne showed you is a shell script (well, bash
script). This script can be used to configure a Firefox-based browser
to access a peer-to-peer filesharing network called "Freenet".

I believe Arne didn't want you to run this script as-it-is (it's not
a Freenet-related thread, after all). He probably wanted you to take
inspiration from a part of it that creates and configures an actual
Firefox profile and starts the browser with it. Here's the relevant part

#+BEGIN_SRC shell-script
# if the profile does not exist yet, create it
if ! test -d ${PROFILE_DIR}; then
mkdir -p ${PROFILE_DIR}
# setup freenet as proxy and optimize settings
cat > ${PROFILE_DIR}/prefs.js  Hi,
> 
> thank you.
> 
> I downloaded this file with wget.
> 
> But how can I now use it? What do I have to do?
> 
> Is it only for icecat? or can I use it also for chromium?
> 
> Kind regards
> 
> Gottfried
> 
> 
> Am 01.03.23 um 18:04 schrieb Dr. Arne Babenhauserheide:
> > 
> > Gottfried  writes:  
> >> would it be a significant improvement for security if I used
> >> Icecat and ungoogled chromium always in a container?
> >> (I am using Icecat with the Tor browser)  
> > 
> > I’m not sure about security of a container there — it could help if
> > there’s an unpatched vulnerability in icecat, but not so much otherwise.
> > 
> > But what can already help a lot is having a separate profile. Here’s an
> > example script that creates a locked-down profile on the fly:
> > 
> > https://github.com/hyphanet/browser/blob/main/freenetbrowser.in#L177
> > 
> > Best wishes,
> > Arne  
> 




pgpFdELfPAvpg.pgp
Description: OpenPGP digital signature


Re: Newbie user: Feedback on custom package definition

2023-03-02 Thread Vagrant Cascadian
On 2023-03-02, Gary Johnson wrote:
> Rodrigo Morales  writes:
>> 3 The questions
>> ===
>>
>>   + What changes would you do to improve the definition of the package
>> that I wrote?
>
> Whenever possible, you should not be using the `trivial-build-system`.

I often wonder if the name "trivial-build-system" should not be
something more like:

  diy-get-your-hands-messy-with-a-lot-of-effort-build-system

I think the word "trivial" implies to people that it should be easy to
use with trivial packaging tasks, when in fact, the build system does so
little that you actually have to do a lot of work to get it to generate
a proper package... I certainly fell down that trap when I first started
working on some packages...


live well,
  vagrant


signature.asc
Description: PGP signature


Re: Newbie user: Feedback on custom package definition

2023-03-02 Thread Gary Johnson
Rodrigo Morales  writes:

> 8<---
> 8<...Text elided...
> 8<---
>
>
> 3 The questions
> ===
>
>   + What changes would you do to improve the definition of the package
> that I wrote?

Whenever possible, you should not be using the `trivial-build-system`.
Guix comes with a wealth of built-in build systems that will take care
of building and installing packages written in many different languages.
For Emacs Lisp packages, you should use the `emacs-build-system`. Here
is an example:

```
(define-public emacs-vcard
  (package
   (name "emacs-vcard")
   (version "0.2.1")
   (source
(origin
 (method url-fetch)
 (uri (string-append
   "https://elpa.gnu.org/packages/vcard-";
   version
   ".tar"))
 (sha256
  (base32 "0nfrh1mz2h7h259kf7sj13z30kmjywfvs83ax5qjkfwxhqm03abf"
   (build-system emacs-build-system)
   (home-page "https://elpa.gnu.org/packages/vcard.html";)
   (synopsis "Package for handling vCard files")
   (description
"This file contains `vcard-mode', for viewing vCard files.  Other files in 
this
package contain functions for parsing and writing vCard data.")
   (license gpl3+)))
```

This will download and validate the source, build the package, install
it under /gnu/store, and symlink it into the profile that you installed
it into. It will take care of adding these directories to these
environment variables, which ensure that Emacs can require them later:

- EMACSLOADPATH
- EMACSNATIVELOADPATH

>   + Do you manage your Emacs packages with GUIX? Could you briefly
> describe your workflow or point me to references/documentation?

I do manage all of my Emacs packages with Guix. I list `emacs` and all
of its packages in a manifest file (emacs.scm). It looks like this with
my custom packages elided:

```
(use-modules ((gnu packages) #:select (specifications->manifest)))

(specifications->manifest
 (list "emacs"
   "emacs-adoc-mode"
   "emacs-alsamixer-el"
   "emacs-async"
   "emacs-calibredb"
   "emacs-cider"
   "emacs-clojure-mode"
   "emacs-company"
   "emacs-crdt"
   "emacs-csv-mode"
   "emacs-elpher"
   "emacs-emms"
   "emacs-eww-lnum"
   "emacs-exwm"
   "emacs-flycheck"
   "emacs-flymake-kondor"
   "emacs-flyspell-correct"
   "emacs-forge"
   "emacs-geiser"
   "emacs-geiser-guile"
   "emacs-gnuplot"
   "emacs-google-translate"
   "emacs-helm"
   "emacs-helm-ag"
   "emacs-helm-descbinds"
   "emacs-helm-swoop"
   "emacs-htmlize"
   "emacs-magit"
   "emacs-markdown-mode"
   "emacs-nov-el"
   "emacs-ob-async"
   "emacs-org"
   "emacs-org-pomodoro"
   "emacs-ox-gfm"
   "emacs-paredit"
   "emacs-pdf-tools"
   "emacs-pinentry"
   "emacs-rjsx-mode"
   "emacs-shroud"
   "emacs-telephone-line"
   "emacs-treemacs"
   "emacs-vterm"
   "emacs-web-mode"
   "emacs-which-key"
   "mu"))
```

I actually split up all the user packages on my system into manifests
and isntall each one into its own profile, which I then activate on
startup. However, that's not really necessary for this example. You can
install the manifest packages above into your user profile with this
command:

```
guix package -m emacs.scm
```

If you want to include packages that you wrote yourself, you can either
add them to your GUIX_PACKAGE_PATH environment variable or you can
create your own Guix channel, add it to your ~/.config/guix/channels.scm
file, and run `guix pull`.

To get help in writing new Guix packages for Emacs, try out the `guix
import elpa` command like so:

```
guix import elpa --archive=melpa gemini-mode
```

Alright. That's it for now. Good luck and happy hacking!

 ~Gary

-- 
Protect yourself from surveillance: https://emailselfdefense.fsf.org
===
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



Re: Icecat and ungoogled chromium in a container

2023-03-02 Thread Gottfried

Hi,

thank you.

I downloaded this file with wget.

But how can I now use it? What do I have to do?

Is it only for icecat? or can I use it also for chromium?

Kind regards

Gottfried


Am 01.03.23 um 18:04 schrieb Dr. Arne Babenhauserheide:


Gottfried  writes:

would it be a significant improvement for security if I used
Icecat and ungoogled chromium always in a container?
(I am using Icecat with the Tor browser)


I’m not sure about security of a container there — it could help if
there’s an unpatched vulnerability in icecat, but not so much otherwise.

But what can already help a lot is having a separate profile. Here’s an
example script that creates a locked-down profile on the fly:

https://github.com/hyphanet/browser/blob/main/freenetbrowser.in#L177

Best wishes,
Arne


--




OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: How to handle concurrent QT versions

2023-03-02 Thread Andreas Enge
Am Wed, Mar 01, 2023 at 09:14:27AM +0100 schrieb Alexander Asteroth:
> guix packages but simply made them compile (after some manual changes to
> the code) in my current environment. If I now run a `guix package -u`
> the libraries (from qtbase) get upgraded from 5.15.5 to 6.3.1 and the
> program fails to run.

Then I suppose that your Qt5 libraries disappear, so that the programs will
not find them; and the newly installed Qt6 libraries will not be of help
(they have a different name and are thus considered, well, different).
To check, you can do "ldd name-of-my-executable", which shows you which
libraries needed by your binary are found or not. So the solution is
to not do a "guix package -u", or to do a
"guix package --do-not-upgrade qtbase qtxxx qtyyy ... -u"
(with a potentially long list of Qt packages in the middle).

It might be easier then to create a separate profile with a manifest only
for your Qt5 development, which you would then avoid to update.
It is something I have not done myself yet, so I will have to refer you
to the documentation.

Andreas




Re: Examples of local-host-entries or hosts-service-type?

2023-03-02 Thread Remco van 't Veer
Hi Bruno,

2023/03/02 02:41, Bruno Victal:

> On 2023-02-27 06:23, Remco van 't Veer wrote:
>>
>> Or when you want to provide extra aliases for localhost?
>>
>> Like this?
>>
>>   (essential-services
>>(modify-services
>>(operating-system-default-essential-services this-operating-system)
>>  (hosts-service-type config =>
>>  (list (host "127.0.0.1" "localhost" (list host-name 
>> "foo" "bar"))
>>(host "::1"   "localhost" (list host-name 
>> "foo" "bar"))
>
> Semantically you're right though I wouldn't outright do this unless it
> results in clearer code or if its really needed.
>
> Reason for this is that the format of /etc/hosts isn't consistently
> defined.
> For instance, there is a limit on the maximum number of
> aliases. (depending on the implementation)
>
> If I wanted to add extra aliases, I'd extend the service with new
> "standalone" host records instead though your snippet is just as
> valid, as long you don't go overboard with the number of aliases.

I not sure all applications will react well to having multiple entries
for the same IP-address.

>From the hosts(5) manpage:

> This file is a simple text file that associates IP addresses with
> hostnames, one line per IP address.

To workaround the alias limit, picking multiple loopback addresses (for
the example above) would be a better solution, it seems.

Cheers,
Remco