xsensors: 0.70 -> 0.80

emaryn f034395a fda348ca

+19 -224
+19 -17
pkgs/by-name/xs/xsensors/package.nix
··· 1 1 { 2 + lib, 2 3 stdenv, 3 - lib, 4 - fetchurl, 5 - gtk2, 4 + fetchFromGitHub, 5 + gtk3, 6 6 pkg-config, 7 7 lm_sensors, 8 8 }: 9 9 10 - stdenv.mkDerivation rec { 10 + stdenv.mkDerivation (finalAttrs: { 11 11 pname = "xsensors"; 12 - version = "0.70"; 13 - src = fetchurl { 14 - url = "http://www.linuxhardware.org/xsensors/xsensors-${version}.tar.gz"; 15 - sha256 = "1siplsfgvcxamyqf44h71jx6jdfmvhfm7mh0y1q8ps4zs6pj2zwh"; 12 + version = "0.80"; 13 + 14 + src = fetchFromGitHub { 15 + owner = "Mystro256"; 16 + repo = "xsensors"; 17 + tag = finalAttrs.version; 18 + hash = "sha256-dITnIMvOYL1gmoDP2w4ZlxcBdAqA/+D3ojm5cP+tTFQ="; 16 19 }; 20 + 17 21 nativeBuildInputs = [ pkg-config ]; 22 + 18 23 buildInputs = [ 19 - gtk2 24 + gtk3 20 25 lm_sensors 21 26 ]; 22 - patches = [ 23 - ./remove-unused-variables.patch 24 - ./replace-deprecated-gtk.patch 25 - ]; 26 - meta = with lib; { 27 - license = licenses.gpl2Plus; 28 - platforms = platforms.linux; 27 + 28 + meta = { 29 + license = lib.licenses.gpl2Plus; 30 + platforms = lib.platforms.linux; 29 31 maintainers = [ ]; 30 32 }; 31 - } 33 + })
-39
pkgs/by-name/xs/xsensors/remove-unused-variables.patch
··· 1 - Author: Nanley Chery <nanleychery@gmail.com> 2 - From: Jean Delvare <khali@linux-fr.org> 3 - Subject: Remove declared, but unused variables 4 - Bug-Debian: http://bugs.debian.org/625435 5 - --- 6 - --- a/src/gui.c 7 - +++ b/src/gui.c 8 - @@ -257,10 +257,9 @@ 9 - 10 - /* Start the sensor info update timer. */ 11 - gint start_timer( GtkWidget *widget, gpointer data ) { 12 - - gint timer; 13 - 14 - /* Setup timer for updates. */ 15 - - timer = g_timeout_add( update_time * 1000, 16 - + g_timeout_add( update_time * 1000, 17 - (GtkFunction) update_sensor_data, 18 - (gpointer) data ); 19 - 20 - @@ -287,7 +286,7 @@ 21 - 22 - /* feature data */ 23 - updates *head = NULL; 24 - - updates *current = NULL, *prev = NULL; 25 - + updates *current = NULL; 26 - 27 - const sensors_feature *feature; 28 - 29 - @@ -347,10 +346,8 @@ 30 - new_node->pbar = featpbar; 31 - 32 - if ( head == NULL ) { 33 - - prev = head; 34 - head = current = new_node; 35 - } else { 36 - - prev = current; 37 - current = current->next = new_node; 38 - } 39 -
-168
pkgs/by-name/xs/xsensors/replace-deprecated-gtk.patch
··· 1 - Author: Nanley Chery <nanleychery@gmail.com> 2 - Subject: Update deprecated gtk casts and replace deprecated function calls with their analogous cairo counterparts. 3 - Bug-Debian: http://bugs.debian.org/622005 4 - Bug-Debian: http://bugs.debian.org/610321 5 - --- 6 - --- a/src/gui.c 7 - +++ b/src/gui.c 8 - @@ -27,10 +27,10 @@ 9 - GtkWidget *mainwindow = NULL; 10 - 11 - GdkColor colorWhite = { 0, 0xFFFF, 0xFFFF, 0xFFFF }; 12 - - 13 - -GdkColormap *cmap = NULL; 14 - 15 - -GdkPixmap *theme = NULL; 16 - +GdkPixbuf *theme = NULL; 17 - + 18 - +cairo_surface_t *surface = NULL; 19 - 20 - /* Destroy the main window. */ 21 - gint destroy_gui( GtkWidget *widget, gpointer data ) { 22 - @@ -76,17 +76,16 @@ 23 - } 24 - } 25 - 26 - -static void draw_digits( GtkWidget *widget, const gchar *digits, int highLow ) 27 - +static void draw_digits( GtkWidget *widget, cairo_t *cr, const gchar *digits, int highLow ) 28 - { 29 - const gchar *digit = digits; 30 - int pos = 0, x = 0, y = 0, w = 0; 31 - 32 - while ( *digit ) { 33 - get_pm_location( *digit, &x, &y, &w ); 34 - - gdk_draw_drawable( widget->window, 35 - - widget->style->fg_gc[ GTK_WIDGET_STATE 36 - - (widget) ], theme, x, y + highLow, 37 - - pos, 0, w, 30 ); 38 - + cairo_set_source_surface (cr, surface, pos-x, 0-(y + highLow)); 39 - + cairo_rectangle(cr, pos, 0, w, 30); 40 - + cairo_fill(cr); 41 - pos += w; 42 - digit++; 43 - } 44 - @@ -102,6 +101,8 @@ 45 - 46 - gchar result[7]; 47 - 48 - + cairo_t *cr = gdk_cairo_create(widget->window); 49 - + 50 - #ifdef DEBUG_XSENSORS 51 - printf( "area.width = %d, area.height = %d\n", event->area.width, 52 - event->area.height ); 53 - @@ -117,13 +118,11 @@ 54 - 55 - /* Display the digits */ 56 - if ( g_snprintf( result, 6, "%5.0f", current->curvalue ) >= 0 ) 57 - - draw_digits( widget, result, highLow ); 58 - + draw_digits( widget, cr, result, highLow ); 59 - 60 - /* Display RPM */ 61 - - gdk_draw_drawable( widget->window, 62 - - widget->style->fg_gc[ GTK_WIDGET_STATE 63 - - (widget) ], theme, 0, 120 + highLow, 64 - - 90, 0, 57, 30 ); 65 - + cairo_set_source_surface (cr, surface, 90-0, 0-(120 + highLow)); 66 - + cairo_rectangle(cr, 90, 0, 57, 30); 67 - break; 68 - case TEMP: 69 - if ( current->curvalue > current->curmax ) 70 - @@ -134,17 +133,15 @@ 71 - 72 - /* Display the digits */ 73 - if ( g_snprintf( result, 7, "%6.1f", current->curvalue ) >= 0 ) 74 - - draw_digits( widget, result, highLow ); 75 - + draw_digits( widget, cr, result, highLow ); 76 - 77 - /* Display degree symbol */ 78 - if ( tf == FALSE ) 79 - x = 0; 80 - else 81 - x = 57; 82 - - gdk_draw_drawable( widget->window, 83 - - widget->style->fg_gc[ GTK_WIDGET_STATE 84 - - (widget) ], theme, x, 60 + highLow, 85 - - 96, 0, 57, 30 ); 86 - + cairo_set_source_surface (cr, surface, 96-x, 0-(60 + highLow)); 87 - + cairo_rectangle(cr, 96, 0, 57, 30); 88 - 89 - break; 90 - case VOLT: 91 - @@ -154,20 +151,17 @@ 92 - 93 - /* Display the digits */ 94 - if ( g_snprintf( result, 7, "%6.2f", current->curvalue ) >= 0 ) 95 - - draw_digits( widget, result, highLow ); 96 - + draw_digits( widget, cr, result, highLow ); 97 - 98 - /* Display V */ 99 - - gdk_draw_drawable( widget->window, 100 - - widget->style->fg_gc[ GTK_WIDGET_STATE 101 - - (widget) ], theme, 114, 60 + highLow, 102 - - 96, 0, 57, 30 ); 103 - - 104 - - 105 - + cairo_set_source_surface (cr, surface, 96-114, 0-(60 + highLow)); 106 - + cairo_rectangle(cr, 96, 0, 57, 30); 107 - break; 108 - default: 109 - break; 110 - } 111 - - 112 - + cairo_fill(cr); 113 - + cairo_destroy(cr); 114 - return TRUE; 115 - } 116 - 117 - @@ -260,7 +254,7 @@ 118 - 119 - /* Setup timer for updates. */ 120 - g_timeout_add( update_time * 1000, 121 - - (GtkFunction) update_sensor_data, 122 - + (GSourceFunc) update_sensor_data, 123 - (gpointer) data ); 124 - 125 - return SUCCESS; 126 - @@ -460,8 +454,6 @@ 127 - g_signal_connect( G_OBJECT (mainwindow), "delete_event", 128 - G_CALLBACK (destroy_gui), NULL ); 129 - 130 - - /* Graphics needed for drawing info. */ 131 - - cmap = gtk_widget_get_colormap( mainwindow ); 132 - 133 - /* Set up the image file used for displaying characters. */ 134 - if ( imagefile == NULL ) { 135 - @@ -481,12 +473,10 @@ 136 - "Image file not found in either location! Exiting!\n" ); 137 - exit( 1 ); 138 - } else { 139 - - theme = gdk_pixmap_colormap_create_from_xpm( NULL, cmap, 140 - - NULL, NULL, "./images/default.xpm" ); 141 - + theme = gdk_pixbuf_new_from_file("./images/default.xpm", NULL ); 142 - } 143 - } else { 144 - - theme = gdk_pixmap_colormap_create_from_xpm( NULL, cmap, 145 - - NULL, NULL, imagefile ); 146 - + theme = gdk_pixbuf_new_from_file(imagefile, NULL ); 147 - } 148 - } else { 149 - if ( stat( imagefile, &sbuf ) != 0 ) { 150 - @@ -495,11 +485,15 @@ 151 - "Image file not found in specified location! Exiting!\n" ); 152 - exit( 1 ); 153 - } else { 154 - - theme = gdk_pixmap_colormap_create_from_xpm( NULL, cmap, 155 - - NULL, NULL, imagefile ); 156 - + theme = gdk_pixbuf_new_from_file(imagefile, NULL ); 157 - } 158 - } 159 - - 160 - + surface = cairo_image_surface_create_for_data(gdk_pixbuf_get_pixels(theme), 161 - + CAIRO_FORMAT_RGB24, 162 - + gdk_pixbuf_get_width(theme), 163 - + gdk_pixbuf_get_height(theme), 164 - + gdk_pixbuf_get_rowstride(theme)); 165 - + 166 - /* Create notebook for sensors. */ 167 - notebook = gtk_notebook_new( ); 168 - gtk_widget_modify_bg( notebook, GTK_STATE_NORMAL, &colorWhite );