giovedì 27 giugno 2024

Packaging software from the CRAN for Guix

Guix shell, together with direnv and Emacs integration, is a lovely tool for installing R packages.

Guix already carries a lot of CRAN-packages, but sometimes I need something not already packaged, at the moment the mfp package.

To help my memory, here is a R function that takes a R package name and returns a tibble with all the information needed to write a Guix package:

library(dplyr);
library(glue);
library(tibble);

metadata_for_guix_packages <- function(package_name)
                                        # Ask R for package details
  available.packages()[package_name, c("Depends",
                                                                "Imports",
                                                                "Suggests",
                                                                "License",
                                                                "Version",
                                                                "Repository")] |>
    as_tibble_row() |>
                                        # Get sha256 from guix download
    (\(x)
      add_column(x, system2(command = "guix",
                                            args = c("download",
                                                           glue("{x$Repository}/{package_name}_{x$Version}.tar.gz")),
                                            stdout = TRUE)[2]))() |>
                                        # Clean up return value
    select(-Repository) |>
    rename("SHA256" = "...[]");
With the output of metadata_for_guix_packages("mfp"), we can easily cobble together a working Guix package definition:
(define r-mfp
  (package
    (name "r-mfp")
    (version "1.5.4.1")
    (source
     (origin
       (method url-fetch)
       (uri (cran-uri "mfp" version))
       (sha256
        (base32 "17sww972ymnddbi54575hdalbshfq81m849795pmi38j3mrhz25m"))))
    (build-system r-build-system)
    (propagated-inputs (list r-survival r-numderiv))
    (native-inputs (list r-knitr r-markdown))
    (home-page "https://cran.r-project.org/web/packages/mfp/index.html")
    (synopsis "R package for regression modelling using fractional polynomial functions")
    (description "Fractional polynomials are used to represent curvature in regression models. A key reference is Royston and Altman, 1994.")
    (license gpl2)))


martedì 15 gennaio 2013

Arsenik 0.5

Changes

Arsenik has been ported to GApplication and now presents the user with a deck browser (getting decks from Tracker) on startup. This view allows the user to learn, edit or print decks.

From now on, the project is migrated from subversion on garage.maemo.org to git at code.google.com/p/arsenik. Maemo.org showed some unnerving downtime.


Plans

Next to do is to fix the trainer (looks like crap), the editor (looks like crap) and refactor the code to make it easier to implement deadlines for learning decks, importing decks from other programs and such.

Download links to the right.

venerdì 12 ottobre 2012

How to install Shairport in raspbian


Shairport is a software that allows you to set up a renderer for airplay streaming. I use it to stream Spotify from Apple devices via a Raspberry pi and a DAC to my living room stereo.

First, install the needed dependencies:

sudo apt-get install build-essential libssl-dev libcrypt-openssl-rsa-perl libao-dev libio-socket-inet6-perl libwww-perl avahi-utils pkg-config
Next, get Shariport and compile it:

git clone https://github.com/albertz/shairport.git; cd shairport/; make

Now you can run it with:

./shairport --buffer=300

This breaks with iOS 6, see this for a fix.

mercoledì 25 aprile 2012

Arsenik 0.4

The editor is now pretty much done. It can create decks (with text or images - editing done in inkscape) and save export them as PDF:s.

New features


  • Port to Gtk 3 and python introspection (including librsvg)
  • Make all long running tasks (export PDF, loading complex decks...) non-blocking
  • UI polish
  • Export deck as directories with cards rendered as .png-files


Get it

Tarball
Debian

mercoledì 1 febbraio 2012

Two anatomy decks done

Two anatomy decks are done - Caput and Brachium.Download the PDF:s for printing or get them in the iphone or android app stores fore use on your phone.


domenica 30 ottobre 2011

Arsenik 0.3.1

Quick bugfix release 0.3.1.

Contains buffert fixes, is a bit more roboust if creating direct bindings to librsvg but still not stable enough for use.

Adds icon property to decks.

Post this comes exporting as android/iOS apps and port to gtk 3!

venerdì 29 luglio 2011

Arsenik 0.3

About Arsenik
Arsenik is a set of tools for type setting flash cards. I started writing it when studying pathology in Padova and used it extensively during surgical exams. After I graduated development slacked off but now I need it to type set decks based on the anatomy course of Uppsala University.

It consists of a deck editor written in pygtk and training apps.

A card has two pages being either SVG or text. The editor allows editing SVG data externally in Inkscape and exporting the deck as a 300 dpi PDF. The editor is tested in fedora and debian, it once ran on OS X and might still do so.

Trainer apps exist for Maemo 5 and OS2008.

Currently Arsenik is well suited to create and learn decks. The maemo trainer app is primitive but tuned through the course of many exams to work effectively.

Changes
(1½ year of development)
  • External editing in Inkscape
  • More robust PDF-export
  • Manually bind librsvg if python bindings not available
  • SVG rendering code respects target size and DPI
  • Each deck has a title card
  • New, simpler, deck format
  • Bug fixes...
Plans
Validating Arsenik as a tool for producing print quality documents. This primarily means adding support for outputting print marks and completing the anatomy decks.

Trying it out
Debian package: http://arsenik.garage.maemo.org/files/arsenik_0.3_all.deb
Maemo package: http://arsenik.garage.maemo.org/files/arsenik-maemo_0.3_all.deb
Archive of sources: http://arsenik.garage.maemo.org/files/arsenik-0.3.tar.gz

When you find bugs, please report them in the bug tracker.